Packetwatch.net

USB hard drive in Red Hat Enterprise Linux



Last modified: Jan. 24, 2013

Contents
1 - Summary
2 - EPEL repository
3 - NTFS-3g installation
4 - Plug in USB hard drive
5 - Mount NTFS partition


1 - Summary

This guide will show how to use a USB hard drive in Red Hat Enterprise Linux.
It explains how to mount an NTFS partition with read/write access on a USB hard
drive using the ntfs-3g driver. The ntfs-3g driver is driver that supports
read/write for NTFS filesystems. This has been tested in Red Hat Enterprise
Linux 6.


2 - EPEL repository

You will need to install the EPEL repository.
# sudo rpm -ivh http://dl.fedoraproject.org/pub/epel/$rel/$arch/epel-release-$ver.noarch.rpm
[sudo] password for user:


3 - NTFS-3g installation

Install the ntfs-3g package using yum.
# sudo yum install ntfs-3g.x86_64
[sudo] password for use:


4 - Plug in USB hard drive

Log in with a normal user account. Plug in the USB hard drive into the
computer and check to make sure it was detected properly.
# dmesg | tail -n 20
Initializing USB Mass Storage driver...
scsi3 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 3
usbcore: registered new driver usb-storage
USB Mass Storage support registered.
usb-storage: waiting for device to settle before scanning
  Vendor: Seagate   Model: FA GoFlex Desk    Rev: 0158
  Type:   Direct-Access                      ANSI SCSI revision: 04
SCSI device sdc: 3907029167 512-byte hdwr sectors (2000399 MB)
sdc: Write Protect is off
sdc: Mode Sense: 1c 00 00 00
sdc: assuming drive cache: write through
SCSI device sdc: 3907029167 512-byte hdwr sectors (2000399 MB)
sdc: Write Protect is off
sdc: Mode Sense: 1c 00 00 00
sdc: assuming drive cache: write through
 sdc: sdc1
sd 3:0:0:0: Attached scsi disk sdc
sd 3:0:0:0: Attached scsi generic sg4 type 0
usb-storage: device scan complete

5 - Mount NTFS partition

Find where the ntfs-3g binary was installed to.
# rpm -ql ntfs-3g-* | grep bin
/bin/lowntfs-3g
/bin/ntfs-3g
/bin/ntfs-3g.probe
/bin/ntfs-3g.secaudit
/bin/ntfs-3g.usermap
/bin/ntfsmount
/sbin/mount.lowntfs-3g
/sbin/mount.ntfs
/sbin/mount.ntfs-3g
/sbin/mount.ntfs-fuse
/usr/bin/ntfs-3g
/usr/bin/ntfsmount

Mount the NTFS partition with read/write access.
# sudo /sbin/mount.ntfs-3g /dev/sdc1 /mnt
[sudo] password for user:

Create a test file on the hard drive.
# sudo echo Test > /mnt/test.txt
[sudo] password for user:
# ls -1 /mnt/test.txt 
/mnt/test.txt
# cat /mnt/test.txt 
Test

Unmount the NTFS partition.
# sudo umount /mnt
[sudo] password for user:


Last modified: Thu Jan 1 00:00:00 1970 UTC
Packetwatch Research 2002-2024.