Ubuntu подключить внешний диск
Да, вы можете установить полную операционную систему Linux на внешний жесткий диск.
Unclean LogFile
If you are mounting drives formatted with NTFS (like most external USB hard disks are), you must first have the ntfs-3g driver installed. This is done automatically in newer versions of Ubuntu. You should also install ntfs-config and enable mounting, which is not done automatically. For ntfs-3g and ntfs-config, see MountingWindowsPartitions.
When a drive is not Safely Removed from a Windows machine (or a forced shutdown occurs from Windows), you may get an error like this when you plug in your drive:
The best option is Choice 1, but you can force the mount by running Choice 2 with sudo. You must then manually unmount it from the terminal (you can't right click the desktop icon):
After that the drive should automount normally again.
Просмотр и управление томами и разделами с помощью дисковой утилиты
You can check and modify your computer’s storage volumes with the disk utility.
Откройте Обзор и запустите приложение Диски .
В списке устройств хранения данных слева находятся жёсткие диски, приводы CD и DVD и другие физические устройства. Чтобы получить информацию об устройстве, нажмите на это устройство в списке.
В панели справа отображается наглядное представление о томах и разделах на выбранном устройстве. В этой же панели содержатся различные элементы для управления этими томами.
Будьте осторожны: этими утилитами можно полностью удалить данные на жёстком диске.
Скорее всего, ваш компьютер имеет по крайней мере один первичный раздел и один раздел подкачки . Раздел подкачки используется операционной системой для управления памятью, и редко монтируется. Первичный раздел содержит операционную систему, приложения, настройки и личные файлы. Эти файлы также могут быть распределены между несколькими разделами по соображениям безопасности или удобства.
One primary partition must contain information that your computer uses to start up, or boot . For this reason it is sometimes called a boot partition, or boot volume. To determine if a volume is bootable, select the partition and click the menu button in the toolbar underneath the partition list. Then, click Edit Partition… and look at its Flags . External media such as USB drives and CDs may also contain a bootable volume.
Как отформатировать диск в Linux?
Форматирование раздела диска с файловой системой NTFS
- Запустите команду mkfs и укажите файловую систему NTFS для форматирования диска: sudo mkfs -t ntfs / dev / sdb1. …
- Затем проверьте изменение файловой системы, используя: lsblk -f.
- Найдите предпочтительный раздел и убедитесь, что он использует файловую систему NFTS.
recent kernels workaround, from Karmic
- Determine your device id using
- Find which bus it is connected to. The bus id can be found as a folder in /sys/bus/pci/drivers/ehci_hcd. The following script explores buses and connected devices: The information is also usually available in /var/log/kern.log
- Unbind the bus (and all devices) from the ehci_hcd driver. Insert the bus id in the following command, using the format 0000:00:xx.x
Могу ли я использовать внешний SSD в качестве загрузочного диска?
Да, вы можете загружаться с внешнего SSD на ПК или компьютере Mac. … Портативные твердотельные накопители подключаются через USB-кабели.
fdisk
Refer back to the logical name you noted from earlier. For illustration, I'll use /dev/sdb, and assume that you want a single partition on the disk, occupying all the free space.
- software that runs at boot time (e.g., old versions of LILO)
- booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK)
Otherwise, this will not negatively affect you.
1) Initiate fdisk with the following command:
2) Fdisk will display the following menu:
3) We want to add a new partition. Type "n" and press enter.
4) We want a primary partition. Enter "p" and enter.
5) Since this will be the only partition on the drive, number 1. Enter "1" and enter.
If it asks about the first cylinder, just type "1" and enter. (We are making 1 partition to use the whole disk, so it should start at the beginning.)
6) Now that the partition is entered, choose option "w" to write the partition table to the disk. Type "w" and enter.
7) If all went well, you now have a properly partitioned hard drive that's ready to be formatted. Since this is the first partition, Linux will recognize it as /dev/sdb1, while the disk that the partition is on is still /dev/sdb.
Configuring Program Autostart
To control which programs automatically start when you plug in a device, go to System-Settings - Details - Removable Media.
For more complex scenarios, see UsbDriveDoSomethingHowto.
Как мне найти свой внешний жесткий диск в Linux?
Чтобы узнать метку внешнего жесткого диска, откройте терминал и используйте следующую команду. Команда lsblk (список блочных устройств) показывает все подключенные диски. Когда команда list block завершится, все подключенные диски появятся в этом списке. Если какие-то жесткие диски используются, это будет легко увидеть.
Configuring Automounting
To enable or disable automount open a terminal and type:
Browse to org.gnome.desktop.media-handling.
The automount key controls whether to automatically mount media. If set to true, Nautilus will automatically mount media such as user-visible hard disks and removable media on start-up and media insertion.
Another key, org.gnome.desktop.media-handling.automount-open, controls whether to automatically open a folder for automounted media.
If set to true, Nautilus will automatically open a folder when media is automounted. This only applies to media where no known x-content type was detected; for media where a known x-content type is detected, the user configurable action will be taken instead. This can be configured as shown below.
Как вручную смонтировать USB-накопитель в Linux?
Чтобы подключить USB-устройство вручную, выполните следующие действия:
- Создайте точку монтирования: sudo mkdir -p / media / usb.
- Предполагая, что USB-накопитель использует устройство / dev / sdd1, вы можете подключить его к каталогу / media / usb, набрав: sudo mount / dev / sdd1 / media / usb.
parted
Refer back to the logical name you noted from earlier. For illustration, I'll use /dev/sdb, and assume that you want a single partition on the disk, occupying all the free space.
1) Start parted as follows:
2) Create a new GPT disklabel (aka partition table):
3) Set the default unit to TB:
4) Create one partition occupying all the space on the drive. For a 4TB drive:
5) Check that the results are correct:
There should be one partition occupying the entire drive.
6) Save and quit "parted":
Using mount
Create the Mount Point
Now we need to create a mount point for the device. Let's say we want to call it "external". You can call it whatever you want, but if you use spaces in the name it gets a little more complicated. Instead, use an underscore to separate words (like "my_external"). Create the mount point:
Unmounting/Ejecting
- Right-click the desktop icon and select "Unmount" (or in some cases, "Eject").
- In the file manager window, click on the "eject" button next to the name of the mounted volume.
- Right-click the icon in the launcher and select "Unmount".
Automatic Mount At Boot
You'll need to edit /etc/fstab:
Add this line to the end (for ext3 file system):
- The defaults part may allow you to read, but not write. To write other partition and FAT specific options must be used. If gnome nautilus is being used, use the right-click, mount method, from computer folder. Then launch the mount command from terminal, no options. The last entry should be the FAT drive and and look something like: All of the parts between the parenthesis are the mount options and should replace "defaults" in the fstab file. The "2" at the end instructs your system to run a quick file system check on the hard drive at every boot. Changing it to "0" will skip this. Run 'man fstab' for more info here.
You can now run "sudo mount -a" (or reboot the computer) to have the changes take effect.
If you want to allow a normal user to create files on this drive, you can either give this user ownership of the top directory of the drive filesystem: (replace USERNAME with the username)
or in a more flexible way, practical if you have several users, allow for instance the users in the plugdev group (usually those who are meant to be able to mount removable disks, desktop users) to create files and sub-directories on the disk:
The last "chmod +t" adds the sticky bit, so that people can only delete their own files and sub-directories in a directory, even if they have write permissions to it (see man chmod).
Partitioning Using GParted
If System > Administration > GNOME Partition Editor (or 'Partition Editor') is not available, install "GParted" using "sudo apt-get install gparted" from the command line, "Add/Remove Software" (or "Add/Remove. ") from the Applications menu, or "Synaptic Package Manager" from the System > Administration menu. Open GParted and let's get started.
Always use gksu or gksudo for graphical applications like gparted and sudo for command line applications, like apt-get.
In the top-right corner of the window, choose your new hard drive from the drop-down list, referring back to the "logical name" from earlier. The window should refresh and show you a representation of the new drive. Assuming that the drive has yet to have been used, a white bar will run across the window. Use these steps to partition the drive with a single partition.
1) Right-click on the white bar and choose "New."
2) For "New Size" the number should be the maximum allowable, to fill the entire disk.
3) Choose "Primary Partition"
4) Now decide on a filesystem. Use "ext3" if the drive will only be used with Ubuntu. For file-sharing between Ubuntu and Windows, you should use "fat32." If you are unsure, search around the wiki and forums for advice.
5) Now click Add to compute the partition. The graphical display should update to show a new partition covering the entire disk.
6) To finish, click "Apply," or Edit > Apply. The disk will then be partitioned and formatted. You may now close GParted.
Как мне получить доступ к своему USB-накопителю в Ubuntu?
Подключите USB-накопитель вручную
Нажмите Ctrl + Alt + T, чтобы запустить Терминал. Введите sudo mkdir / media / usb, чтобы создать точку монтирования с именем usb. Введите sudo fdisk -l, чтобы найти уже подключенный USB-накопитель, скажем, диск, который вы хотите смонтировать, - это / dev / sdb1.
USB 2 Issues
Command Line Formatting
To format the new partition as ext4 file system (best for use under Ubuntu):
To format the new partition as fat32 file system (best for use under Ubuntu & Windows):
As always, substitute "/dev/sdb1" with your own partition's path.
When formatting the drive as ext2/ext3, 5% of the drive's total space is reserved for the super-user (root) so that the operating system can still write to the disk even if it is full. However, for disks that only contain data, this is not necessary.
NOTE: You may run this command on a fat32 file system, but it will do nothing; therefore, I highly recommend not running it.
You can adjust the percentage of reserved space with the "tune2fs" command, like this:
Now that the drive is partitioned and formatted, you need to choose a mount point. This will be the location from which you will access the drive in the future. I would recommend using a mount point with "/media", as it is the default used by Ubuntu. For this example, we'll use the path "/media/mynewdrive"
Now we are ready to mount the drive to the mount point.
You can choose to have the drive mounted automatically each time you boot the computer, or manually only when you need to use it.
Как установить внешний жесткий диск в Ubuntu?
Монтирование внешнего диска на сервере Ubuntu
- Получить информацию об устройстве: $ lsblk. или $ sudo fdisk -l.
- Создайте точку монтирования. В приведенном ниже примере имя точки монтирования - «внешняя». Вы можете называть его как хотите. $ sudo mkdir / media / external. для устройств, отформатированных в FAT16 или FAT32: $ sudo mount / dev / sdb1 / media / external. …
- Отключение диска.
Command Line Partitioning
There are two commands that can be used in the command line to partition a new drive: fdisk and parted. fdisk is an older program, and its main downside is that it can only create MBR partitions. parted allows you to create MBR or GPT partitions.
Mounting
By default, storage devices that are plugged into the system mount automatically in the /media/ directory, open a file browser window for each volume and place an icon on your desktop. The rationale for this slight change of behavior can be found here. If you plug in a usb hard disk with many partitions, all of the partitions will automatically mount. This behaviour may not be what you want; you can configure it as shown below.
If the volumes have labels the icons will be named accordingly. Otherwise, they will be named "disk", "disk-1" and so on.
To change the volume label see RenameUSBDrive.
USB-Device is or becomes read-only without errors
If you see "Write Protect is off" and no errors in your logfiles, than you should set filesystem type specific mount options (FS_MOUNTOPTIONS) in /etc/usbmount/usbmount.conf. Wrong gid causes mounting read only.
Unmounting the Drive
When you are finished with the device, don't forget to unmount the drive before disconnecting it. Assuming /dev/sdb1 is mounted at /media/external, you can either unmount using the device or the mount point:
You cannot unmount from the desktop by right-clicking the icon if the drive was manually mounted.
Как добавить жесткий диск в Linux?
Смонтированные файловые системы или логические тома
Самый простой способ - создать раздел Linux на новом диске. Создайте файловую систему Linux на этих разделах, а затем смонтируйте диск в определенной точке монтирования, чтобы к ним можно было получить доступ.
Seeking Further Help
The best place to get help with almost any Ubuntu problem is on the Ubuntu Forums. The Absolute Beginner Talk section is best for beginners.
Слово том используется для описания устройства хранения информации, например, жёсткого диска. Также так может называться часть хранилища на этом устройстве, поскольку хранилище можно разбить на отдельные части. Хранилище становятся доступны благодаря файловой системе, в результате процесса, который называется монтирование . Смонтированным томом может быть жёсткий диск, USB диск, привод DVD-RW, карта памяти SD и другие носители информации. Файлы на смонтированном томе доступны для чтения и, возможно, для записи.
Смонтированный том часто называют разделом , хотя это не всегда одно и то же. «Разделом» называется физическая область хранения на одном дисковом приводе. Как только раздел был смонтирован, его можно называть томом, поскольку его файлы теперь доступны. Том можно представить как подписанную и доступную «витрину», представляющую функционал «служебных помещений» разделов и приводов.
Может ли Linux читать жесткий диск Windows?
При использовании операционной системы Linux невозможно получить доступ к диску Windows. Например, у вас могут быть изображения, которые вы хотите отредактировать в Linux. Возможно, есть видео, которое вы хотите посмотреть; у вас могут быть документы, над которыми вы хотите поработать.
Как мне получить доступ к внешнему жесткому диску в Ubuntu?
После установки вы можете получить к нему доступ через Nautilus (браузер файлов графического интерфейса Ubuntu по умолчанию). Он должен быть указан в списке слева, если это не так, нажмите Ctrl + L и введите / media / Skliros_Diskos. Или вы получаете доступ к нему в терминале с помощью cd / media / Skliros_Diskos.
Могу ли я установить Linux на внешний жесткий диск?
Подключите внешнее USB-устройство к USB-порту компьютера. Вставьте установочный CD / DVD Linux в привод CD / DVD на компьютере. Компьютер загрузится, и вы увидите экран публикации. … Выберите загрузку с CD / DVD.
old kernels workaround
If you encounter problems using your USB device with USB 2 (i.e. 'high speed' mode), you can revert to the 'full speed' mode (slower) by unloading ehci_hcd. To do that, type in a terminal:
before plugging in your device.
Preferences
NOTE: This does not seem to apply to Hardy Heron.
Могу ли я использовать внешний SSD в качестве загрузочного диска?
Да, вы можете загружаться с внешнего SSD на ПК или компьютере Mac. … Портативные твердотельные накопители подключаются через USB-кабели.
Могу ли я загрузить Linux с внешнего жесткого диска?
Да, вы можете установить полную операционную систему Linux на внешний жесткий диск.
Как мне найти свой внешний жесткий диск в Linux?
Чтобы узнать метку внешнего жесткого диска, откройте терминал и используйте следующую команду. Команда lsblk (список блочных устройств) показывает все подключенные диски. Когда команда list block завершится, все подключенные диски появятся в этом списке. Если какие-то жесткие диски используются, это будет легко увидеть.
Get the Information
Sometimes, devices don't automount, in which case you should try to manually mount them. First, you must know what device you are dealing with and what filesystem it is formatted with. Most flash drives are FAT16 or FAT32 and most external hard disks are NTFS. Type the following:
Find your device in the list. It is probably something like /dev/sdb1. For more information about filesystems, see LinuxFilesystemsExplained.
Buffer I/O Errors
If you see errors related to Buffer I/O when attaching a USB storage device, there are two ways to work around it. First, try using varying max_sectors settings, as such:
Try values of 120, 64 and 32.
If this does not resolve the issue, then you may need an unusual_dev entry for your device. It would look something like this:
The vendor and device IDs can be obtained from the output of "lsusb". The entry would be placed in drivers/usb/storage/unusual_devs.h. If you cannot compile your own kernel, please file a bug report, and we'll attempt to compile a test module for you.
Как сделать мой внешний жесткий диск загрузочным?
Первый шаг - подключить внешний жесткий диск и выполнить поиск по запросу «дисковая утилита». После этого появится интерфейс со списком доступных жестких дисков. В этом случае выберите внешний жесткий диск, который вы планируете загружать. Нажмите на опцию и выберите «Таблица разделов GUID».
Где мой USB в терминале Linux?
Широко используемая команда lsusb может использоваться для вывода списка всех подключенных USB-устройств в Linux.
This guide goes over procedures for a single partition drive install only. Multiple partition drive installations are not very hard, and you may very well figure it out by using this guide; however, make sure you add an entry in /etc/fstab for each partition, not just the drive.
A Note about File Systems:
Drives that are going to be used only under Ubuntu should be formatted using the ext3/ext4 file system (depending on which version of Ubuntu you use and whether you need Linux backwards compatibility). For sharing between Ubuntu and Windows, FAT32 is often the recommended file system, although NTFS works quite well too. If you are new to file systems and partitioning, please do some preliminary research on the two before you attempt this procedure.
We assume that the hard drive is physically installed and detected by the BIOS.
To determine the path that your system has assigned to the new hard drive, open a terminal and run:
This should produce output similar to this sample:
Be sure to note the "logical name" entry, as it will be used several times throughout this guide.
If you have already formatted the drive and it contains data, skip this step and move on to "Mount Point." If the drive is still blank and unformatted, then you have two options: formatting the drive using the command line, or installing GParted for a graphical approach. Decide whether you want the drive to contain one single partition, or if you want to divide the space up between two or more partitions.
Using Disks
Disks (the GNOME disk utility) is an application for visually managing disk drives and media. When you run it, you will see a list of your drives, including USB drives. If you click a drive on the list, you can view its details, and you can click the triangle-shaped button (Play button) to mount the drive. (This method works even when the drive does not auto-mount.)
Using pmount
There is a program called pmount available in the repositories which allows unprivileged users to mount drives as if they were using sudo, even without an entry in /etc/fstab. This is perfect for computers that have users without RootSudo access, like public terminals or thin clients.
pmount can be used with the same syntax as mount (but without sudo), or quite simply as follows:
- This will mount the device /dev/sdb1 at /media/flash_drive.
If you leave off the label option, it will mount by default at /media/device.
To unmount the device, use pumount, like so:
For more help, see the man pages for pmount and pumount.
Before disconnecting devices, you must unmount them first. This is similar to "Safely Remove" in Windows in that the device won't unmount until data is finished being written to the device, or until other programs are finished using it. This applies to all types of storage devices, including flash drives, flash cards, external hard drives, ipods and other media players, and even remote storage like Samba or NFS shares.
Failure to unmount before disconnecting the device can result in loss of data and/or a corrupted file system. There are no exceptions to this rule. Be safe - unmount your drives before disconnecting them!
To see a list of your USB devices (the vendor and device ID's), run:
To see all attached storage devices and their partitions, run:
To see information about currently mounted systems, simply run:
Presented here are some common problems users encounter.
User Privileges
If your usb device doesn't appear on your desktop, you should check that your user has the correct privileges. Go to System->Administration->User and Groups, choose the user, click on "Properties", then go to the "User Privileges" tab. You should have the "Access external storage devices automatically" option checked.
Как увеличить дисковое пространство на виртуальной машине Linux?
Расширение разделов на виртуальных машинах Linux VMware
GPT vs MBR
MBR (Master Boot Record) has two main limitations: you cannot have a partition larger than 2 TB and you cannot have more than 4 primary partitions. GPT (GUID Partition Table) can do both of these things, but it is part of the EFI standard. This means your kernel must support EFI. The latest version of the kernel supports EFI, and almost all the latest distros do too.
Можно ли запустить операционную систему с внешнего жесткого диска?
Пользователи могут носить с собой внешний жесткий диск и получать доступ к своим файлам с любого компьютера в мире. … Установка ОС Windows на внешний жесткий диск очень похожа на установку Windows или любой другой операционной системы на внутренний жесткий диск.
Interfering services
Two services/programs responsible for automounting might interfere and thereby prevent a successful automount and permission setting.
Example: Activating the Automount function of Nautilus while using pmount will result in read-only permissions for normal users. Either disable Nautilus' Automount function or deinstall pmount.
Manually Mount
Alternatively, you may want to manually mount the drive every time you need it.
For manual mounting, use the following command:
When you are finished with the drive, you can unmount it using:
That's it
InstallingANewHardDrive (последним исправлял пользователь runverzagt 2019-01-25 15:30:08)
The material on this wiki is available under a free license, see Copyright / License for details
You can contribute to this wiki, see Wiki Guide for details
This page explains how to use USB drives, like external hard disks and USB flash drives (aka USB sticks, thumb drives, pen drives, etc). The material here also applies to flash cards (like in your digital camera).
USB storage devices have the enormous advantage that for the most part they use a standard set of protocols. Thus, instead of needing individual drivers, as does much computer hardware, a standard driver permits access to the devices, making them very portable and able to easily work on many platforms.
For help with internal hard drives, see Fstab and MountingWindowsPartitions.
Auto-mounting (Ubuntu Server)
By default, disk drives do not auto-mount in Ubuntu Server Edition. If you are looking for a lightweight solution that does not depend on HAL/DBUS, you can install "usbmount".
Mount the Drive
We can now mount the drive. Let's say the device is /dev/sdb1, the filesystem is FAT16 or FAT32 (like it is for most USB flash drives), and we want to mount it at /media/external (having already created the mount point):
The options following the "-o" give you ownership of the drive, and the masks allow for extra security for file system permissions. If you don't use those extra options you may not be able to read and write the drive with your regular username.
Otherwise, if the device is formatted with NTFS, run:
Note: You must have the ntfs-3g driver installed. See MountingWindowsPartitions for more information.
General tip
When you encounter problems with USB devices, the first thing to do is to check the latest debug information generated from the kernel just after you plug in your device and/or just after you encounter the problem.
To do that, open a terminal and type :
Check the latest messages; they should be related to your problem.
Device suddenly becomes read-only
If your device changes suddenly to read-only mode, and you see this kind of error:
This might be the sign of an unclean device. You should check your device. Try TestingStorageMedia to do so. Or use "Disk Utility" (under System, Administration), find your device, unmount it, check the file system, then mount it again.
Как добавить жесткий диск в VMware Linux?
В инвентаризации клиента vSphere щелкните виртуальную машину правой кнопкой мыши и выберите Изменить параметры. Щелкните вкладку «Оборудование» и нажмите «Добавить». Выберите «Жесткий диск» и нажмите «Далее». Завершите работу мастера.
Как мне получить доступ к внешнему жесткому диску в Linux?
Как смонтировать USB-накопитель в системе Linux
- Шаг 1. Подключите USB-накопитель к компьютеру.
- Шаг 2 - Обнаружение USB-накопителя. После того, как вы подключите USB-устройство к USB-порту системы Linux, оно добавит новое блочное устройство в каталог / dev /. …
- Шаг 3 - Создание точки монтирования. …
- Шаг 4 - Удалите каталог на USB. …
- Шаг 5 - Форматирование USB.
Читайте также: