Escolar Documentos
Profissional Documentos
Cultura Documentos
https://help.ubuntu.com/community/Mount/USB
Partners
Support
Community
Ubuntu.com
Page History
Login to edit
Search
Mount/USB
Introduction
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.
Automounting
Mounting
Contents
1. Introduction
2. Automounting
1. Mounting
2. Configuring Automounting
3. Configuring Program
Autostart
4. Auto-mounting (Ubuntu
Server)
3. Manually Mounting
1. Using Disks
2. Using mount
3. Using pmount
4. The Importance of Unmounting
5. Other Useful Commands
6. Troubleshooting
1. Interfering services
2. Unclean LogFile
3. User Privileges
4. Preferences
5. USB 2 Issues
6. Buffer I/O Errors
7. Device suddenly becomes
read-only
8. USB-Device is or becomes
read-only without errors
9. General tip
10. Seeking Further Help
7. Other Resources
1 of 8
2016-12-21 07:00 PM
https://help.ubuntu.com/community/Mount/USB
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.
Configuring Automounting
To enable or disable automount open a terminal and type:
dconf-editor
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.
Unmounting/Ejecting
Before you disconnect the device, don't forget to unmount it. This can be done in one of the following
ways:
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".
Manually Mounting
2 of 8
2016-12-21 07:00 PM
https://help.ubuntu.com/community/Mount/USB
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 mount
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:
sudo fdisk -l
Find your device in the list. It is probably something like /dev/sdb1. For more information about
filesystems, see LinuxFilesystemsExplained.
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:
sudo mount -t ntfs-3g /dev/sdb1 /media/external
Note: You must have the ntfs-3g driver installed. See MountingWindowsPartitions for more
information.
2016-12-21 07:00 PM
https://help.ubuntu.com/community/Mount/USB
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:
sudo umount /dev/sdb1
or:
sudo umount /media/external
You cannot unmount from the desktop by right-clicking the icon if the drive was manually mounted.
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:
pmount <device> [ label ]
Example:
pmount /dev/sdb1 flash_drive
Example:
pumount /dev/sdb1
For more help, see the man pages for pmount and pumount.
4 of 8
2016-12-21 07:00 PM
https://help.ubuntu.com/community/Mount/USB
Troubleshooting
Presented here are some common problems users encounter.
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.
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:
$LogFile indicates unclean shutdown (0, 0)
Failed to mount '/dev/sda1': Operation not supported
Mount is denied because NTFS is marked to be in use. Choose one action:
Choice 1: If you have Windows then disconnect the external devices by
clicking on the 'Safely Remove Hardware' icon in the Windows
taskbar then shutdown Windows cleanly.
Choice 2: If you don't have Windows then you can use the 'force' option for
your own responsibility. For example type on the command line:
mount -t ntfs-3g /dev/sda1 /media/sda1/ -o force
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):
5 of 8
2016-12-21 07:00 PM
https://help.ubuntu.com/community/Mount/USB
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.
Preferences
If your usb device doesn't appear on your desktop, you should check that the automount action is
enabled in the preferences:
Navigate to System->Preferences->Removable Drives and Media
Verify that all "Mount removable drives when..." are checked.
NOTE: This does not seem to apply to Hardy Heron.
USB 2 Issues
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:
sudo rmmod ehci_hcd
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:
pushd /sys/bus/pci/drivers/ehci_hcd > /dev/null
for bus in 0000:??:??.? ; do
echo "ehci_hcd bus $bus"
pushd $bus/usb1 > /dev/null
6 of 8
2016-12-21 07:00 PM
https://help.ubuntu.com/community/Mount/USB
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.
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.
7 of 8
2016-12-21 07:00 PM
https://help.ubuntu.com/community/Mount/USB
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 :
dmesg
Other Resources
Some other related material:
RenameUSBDrive
BootFromUSB
UsbDriveDoSomethingHowto
http://en.wikipedia.org/wiki/USB_flash_drive
DebuggingUSBStorage
CategoryHardware CategoryUsb
Mount/USB (last edited 2015-06-02 00:24:50 by jacob3 @ CPE503955526a2dCM503955526a2a.cpe.net.cable.rogers.com[99.235.168.12]:jacob3)
8 of 8
2016-12-21 07:00 PM