个人工具

“UbuntuHelp:UsbFlashDrives”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
第2行: 第2行:
 
{{Languages|UbuntuHelp:UsbFlashDrives}}
 
{{Languages|UbuntuHelp:UsbFlashDrives}}
 
This page explains how to use USB flash drives - USB sticks and other USB storage devices - with Ubuntu.
 
This page explains how to use USB flash drives - USB sticks and other USB storage devices - with Ubuntu.
 
 
 
== Introduction ==
 
== Introduction ==
 
 
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.
 
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.
 
 
== Use ==
 
== Use ==
 
 
==== Mounting your USB drive ====
 
==== Mounting your USB drive ====
 
 
Generally all you need to do to use your storage device is to plug it into a USB port. The device should be automatically recognised and appear on your GNOME desktop.
 
Generally all you need to do to use your storage device is to plug it into a USB port. The device should be automatically recognised and appear on your GNOME desktop.
 
 
Open Questions (perhaps someone can answer this?): How does the GNOME desktop mount the USB device? Is hotplug involved? Can the user influence the mount point? what services do this? Where are their config files?
 
Open Questions (perhaps someone can answer this?): How does the GNOME desktop mount the USB device? Is hotplug involved? Can the user influence the mount point? what services do this? Where are their config files?
 
 
==== Unmounting/Ejecting your USB drive ====
 
==== Unmounting/Ejecting your USB drive ====
 
 
This is an important thing to do.
 
This is an important thing to do.
 
When you have finished using your storage device, you must right click on it's icon and select eject before unplugging it. This ensures that any files being written to the device are permanently saved and informs any programs that may be using files on the device.
 
When you have finished using your storage device, you must right click on it's icon and select eject before unplugging it. This ensures that any files being written to the device are permanently saved and informs any programs that may be using files on the device.
 
 
==== More ====
 
==== More ====
 
* [[UbuntuHelp:DebuggingUSBStorage]]
 
* [[UbuntuHelp:DebuggingUSBStorage]]
 
* UsbDriveDoSomethingHowto
 
* UsbDriveDoSomethingHowto
 
 
== Troubleshooting ==
 
== Troubleshooting ==
 
 
As always, there is exceptions to the rules, and you might encounter some problems to mount your USB device. We present here some common problems you could encounter (if you know others, please share them here. Thanks)
 
As always, there is exceptions to the rules, and you might encounter some problems to mount your USB device. We present here some common problems you could encounter (if you know others, please share them here. Thanks)
 
 
=== User Privileges ===
 
=== User Privileges ===
 
 
If your usb device doesn't appear on your desktop, you should check that your user has the correct privileges:
 
If your usb device doesn't appear on your desktop, you should check that your user has the correct privileges:
 
 
* Navigate to "System" > "Administration" > "User and Groups"
 
* Navigate to "System" > "Administration" > "User and Groups"
 
* Choose the user, click on "Properties"
 
* Choose the user, click on "Properties"
 
* Go to the "User Privileges" tab
 
* Go to the "User Privileges" tab
 
 
You should have the "Access external storage devices automatically" option checked.
 
You should have the "Access external storage devices automatically" option checked.
 
 
=== Preferences ===
 
=== Preferences ===
 
 
If your usb device doesn't appear on your desktop, you should check that the automount action is enabled in the 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"
 
* Navigate to "System" > "Preferences" > "Removable Drives and Media"
 
* Verify that all "Mount removable drives when..." are checked.
 
* Verify that all "Mount removable drives when..." are checked.
 
 
=== General tip ===
 
=== General tip ===
 
 
When you encounter problems with an USB device, the first thing to do is to check the latest debug information from the kernel just after you plug your device and/or just after you encounter a problem.
 
When you encounter problems with an USB device, the first thing to do is to check the latest debug information from the kernel just after you plug your device and/or just after you encounter a problem.
 
To do that, open a terminal and type :
 
To do that, open a terminal and type :
第53行: 第33行:
 
</nowiki></pre>
 
</nowiki></pre>
 
Check the latest message, they should be related to your problem.
 
Check the latest message, they should be related to your problem.
 
 
=== USB 2 Issues ===
 
=== USB 2 Issues ===
 
 
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 :
 
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 :
 
<pre><nowiki>
 
<pre><nowiki>
第61行: 第39行:
 
</nowiki></pre>
 
</nowiki></pre>
 
before pluging your device.
 
before pluging your device.
 
 
=== Buffer I/O Errors ===
 
=== 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:
 
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:
 
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo sh -c "echo 120 > /sys/block/sda/queue/max_sectors_kb"
 
sudo sh -c "echo 120 > /sys/block/sda/queue/max_sectors_kb"
 
</nowiki></pre>
 
</nowiki></pre>
 
 
Try values of 120, 64 and 32.
 
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:
 
If this does not resolve the issue, then you may need an unusual_dev entry for your device. It would look something like this:
 
 
<pre><nowiki>
 
<pre><nowiki>
 
UNUSUAL_DEV(0x03eb , 0x2002, 0x0100, 0x9999,
 
UNUSUAL_DEV(0x03eb , 0x2002, 0x0100, 0x9999,
第81行: 第53行:
 
US_FL_IGNORE_RESIDUE),
 
US_FL_IGNORE_RESIDUE),
 
</nowiki></pre>
 
</nowiki></pre>
 
 
The vendor and device ID's 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.
 
The vendor and device ID's 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.
 
 
=== Device become suddenly read only ===
 
=== Device become suddenly read only ===
 
 
If your device change suddenly to read only mode, and you see that kind of error:
 
If your device change suddenly to read only mode, and you see that kind of error:
 
 
<pre><nowiki>
 
<pre><nowiki>
 
[17183798.908000] FAT: Filesystem panic (dev sda1)
 
[17183798.908000] FAT: Filesystem panic (dev sda1)
第93行: 第61行:
 
[17183798.908000]    File system has been set read-only
 
[17183798.908000]    File system has been set read-only
 
</nowiki></pre>
 
</nowiki></pre>
 
 
This might be the sign of an unclean device.
 
This might be the sign of an unclean device.
 
You should check your device. Try TestingStorageMedia to do so.
 
You should check your device. Try TestingStorageMedia to do so.
 
 
 
----
 
----
 
 
[[category:CategoryHardware]]
 
[[category:CategoryHardware]]
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2007年11月30日 (五) 22:03的版本

This page explains how to use USB flash drives - USB sticks and other USB storage devices - with Ubuntu.

Introduction

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.

Use

Mounting your USB drive

Generally all you need to do to use your storage device is to plug it into a USB port. The device should be automatically recognised and appear on your GNOME desktop. Open Questions (perhaps someone can answer this?): How does the GNOME desktop mount the USB device? Is hotplug involved? Can the user influence the mount point? what services do this? Where are their config files?

Unmounting/Ejecting your USB drive

This is an important thing to do. When you have finished using your storage device, you must right click on it's icon and select eject before unplugging it. This ensures that any files being written to the device are permanently saved and informs any programs that may be using files on the device.

More

Troubleshooting

As always, there is exceptions to the rules, and you might encounter some problems to mount your USB device. We present here some common problems you could encounter (if you know others, please share them here. Thanks)

User Privileges

If your usb device doesn't appear on your desktop, you should check that your user has the correct privileges:

  • Navigate to "System" > "Administration" > "User and Groups"
  • Choose the user, click on "Properties"
  • 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.

General tip

When you encounter problems with an USB device, the first thing to do is to check the latest debug information from the kernel just after you plug your device and/or just after you encounter a problem. To do that, open a terminal and type :

dmesg

Check the latest message, they should be related to your problem.

USB 2 Issues

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

before pluging your device.

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:

sudo sh -c "echo 120 > /sys/block/sda/queue/max_sectors_kb"

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:

UNUSUAL_DEV(0x03eb , 0x2002, 0x0100, 0x9999,
"Generic",
"MusicDrive",
US_SC_DEVICE, US_PR_DEVICE, NULL,
US_FL_IGNORE_RESIDUE),

The vendor and device ID's 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.

Device become suddenly read only

If your device change suddenly to read only mode, and you see that kind of error:

[17183798.908000] FAT: Filesystem panic (dev sda1)
[17183798.908000]     fat_get_cluster: invalid cluster chain (i_pos 0)
[17183798.908000]     File system has been set read-only

This might be the sign of an unclean device. You should check your device. Try TestingStorageMedia to do so.