Home


Issue:
How do I use a USB storage device with my Red Hat Enterprise Linux system?
Resolution:
USB storage devices are supported by Red Hat Enterprise Linux, but a few steps must be taken to make the device accessible. After plugging in the device, the system logs must be checked to see how the device was detected. Then the drive must be mounted. Before removing a USB storage device, it is very important to use the umount command to flush any buffered data to the device. If the device is unplugged before this happens, data corruption may occur. Here are the steps to follow to insert a USB storage device:

Inserting a USB storage device
  1. Plug in the device.
  2. Check the contents of the file /var/log/dmesg to see what the system named the device. (You can use the command dmesg as well.) It should appear as a SCSI device, so the name should be similar to /dev/sda or /dev/sdb.
  3. Use the command fdisk -l <devicename> , replacing <devicename> with the device name from /var/log/dmesg to determine the partitions on the device. Most USB flash drives and other portable storage media types have only one partition, so the output of the fdisk command will most likely be something like /dev/sda1 or /dev/sdb1.
  4. Create a directory (mkdir) to serve as the drive's mount point. It is recommended to use a name that is easy to remember like /mnt/usb.
  5. Mount the device with the mount command. If the device was detected as /dev/sda and the fdisk command showed /dev/sda1 as your partition, the command would be:
    mount /dev/sda1 /mnt/usb
    The mount command should automatically detect the partition type and mount the drive. It can be problematic to add the mount command to the file/etc/fstab, as the device may be detected with a different name if system devices are changed or if more than one USB device is plugged in at the same time. For this reason, it is recommended to mount the device manually with the full mount command listed above instead of relying on an entry in /etc/fstab.
Unmounting and removing a USB storage device

It is VERY IMPORTANT to unmount the drive before unplugging it. When the device is written to, some of the data is cached in system memory and not immediately written to the device. If the device is unplugged before it is unmounted, all the data on the device could be corrupted. Please follow this procedure to unmount and then unplug USB storage devices:
  1. Close all programs accessing the device or change directories in these programs to a location not on the USB device. If any programs are still accessing the device, it will not be possible to unmount it.
  2. Issue the command umount /mnt/usb, where /mnt/usb is the mount point you created in the first set of directions. Note that the command is called umount, not unmount. There is no n in the command name.
  3. When the umount command completes and the prompt returns, the storage device can be safely unplugged. Hi,
    A unsupported and highly developmental kernel module is available which allows a read-only mounting of an NTFS partition. you can check following kbase for more details on that but it is not recommended.  

    http://kbase.redhat.com/faq/FAQ_80_4297.shtm

    You can format USB hard drive by fdisk utility. before going to the partitioning issue please take a look at the following kbase article that talks on howto setup a USB storage device

    http://kbase.redhat.com/faq/FAQ_79_4161.shtm
     
    There are  kbase available for how to delete partition using fdisk.

    http://kbase.redhat.com/faq/FAQ_43_3866.shtm

    How do you use fdisk to add a primary partition?

    http://kbase.redhat.com/faq/FAQ_43_3822.shtm


    How do I create a new ext3 file system if a disk was added to the system?

    http://kbase.redhat.com/faq/FAQ_80_381.shtm

    I would require the sysreport of the system. Sysreport would provide me the information regarding the disk layout.

    Sysreport can be obtained using the following command:
    # /usr/sbin/sysreport

    Above command will create a tar file in /tmp location. Please attach the file in reply with this service request.

    Please make sure that you have installed the latest sysreport package. If not please install the latest using the command

    up2date -u sysreport

    Regards,
    Manish Gaikwad