NTFSでフォーマットした外付けUSBHDDをLinuxにマ
●NTFSでフォーマットした外付けUSBHDDをLinuxにマウントする
OS:CentOS5.5
USBHDD:BUFFALO HD-PHG80U2/UC
http://www.tuxera.com/ からどうにかしてソースコードを入手する。
どうにかってこうにか、
# wget http://downloads.sourceforge.net/project/fuse/fuse-2.X/2.8.5/fuse-2.8.5.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Ffuse%2Ffiles%2Ffuse-2.X%2F2.8.5%2Ffuse-2.8.5.tar.gz%2Fdownload&ts=1292046161&use_mirror=jaist
サイトのCommunityタブをクリックして、左側のメニューのNTFS-3Gをクリックするとstable versionのリンクが出てくる。
展開する
# tar zxvf ntfs-3g-2010.10.2.tgz
# cd ntfs-3g-2010.10.2
# ./configure
# make
# make install
使い方はこんな感じ
USAGE
=====
If there was no error during installation then the NTFS volume can be
read-write mounted for everybody the following way as the root user
(unmount the volume if it was already mounted, and replace /dev/sda1
and /mnt/windows, if needed):
mount -t ntfs-3g /dev/sda1 /mnt/windows
or
ntfs-3g /dev/sda1 /mnt/windows
Please see the ntfs-3g manual page for more options and examples.
You can also make NTFS to be mounted during boot by putting the below
line at the END(!) of the /etc/fstab file:
/dev/sda1 /mnt/windows ntfs-3g defaults 0 0
接続したUSBHDDのデバイスファイル名の確認はUSBHDDを接続して、
# cat /var/log/messages
Dec 11 14:05:59 fs kernel: usb 2-2: new high speed USB device using ehci_hcd and address 2
Dec 11 14:05:59 fs kernel: usb 2-2: configuration #1 chosen from 1 choice
Dec 11 14:05:59 fs kernel: Initializing USB Mass Storage driver...
Dec 11 14:05:59 fs kernel: scsi6 : SCSI emulation for USB Mass Storage devices
Dec 11 14:05:59 fs kernel: usbcore: registered new driver usb-storage
Dec 11 14:05:59 fs kernel: USB Mass Storage support registered.
Dec 11 14:06:04 fs kernel: Vendor: SAMSUNG Model: MP0804H Rev: YS20
Dec 11 14:06:04 fs kernel: Type: Direct-Access ANSI SCSI revision: 02
Dec 11 14:06:04 fs kernel: SCSI device sdb: 156162960 512-byte hdwr sectors (79955 MB)
Dec 11 14:06:04 fs kernel: sdb: Write Protect is off
Dec 11 14:06:04 fs kernel: sdb: assuming drive cache: write through
Dec 11 14:06:04 fs kernel: SCSI device sdb: 156162960 512-byte hdwr sectors (79955 MB)
Dec 11 14:06:04 fs kernel: sdb: Write Protect is off
Dec 11 14:06:04 fs kernel: sdb: assuming drive cache: write through
Dec 11 14:06:05 fs kernel: sdb: sdb1
Dec 11 14:06:05 fs kernel: sd 6:0:0:0: Attached scsi disk sdb
Dec 11 14:06:05 fs kernel: sd 6:0:0:0: Attached scsi generic sg2 type 0
sdb1だねってことで、(中身はsamsungみたい)
確認
# /sbin/fdisk -l /dev/sdb
Disk /dev/sdb: 79.9 GB, 79955435520 bytes
255 heads, 63 sectors/track, 9720 cylinders
Units = シリンダ数 of 16065 * 512 = 8225280 bytes
デバイス Boot Start End Blocks Id System
/dev/sdb1 1 9720 78075868+ 7 HPFS/NTFS
まず、マウントポイントを作って、
# mkdir /mnt/usbhdd
マウント実行
# mount -t ntfs-3g /dev/sdb1 /mnt/usbhdd
マウント解除
# umount /mnt/usbhdd