掛載移動硬盤
一。眾所周知,在安裝完Centos完了以后,是沒有編譯環境的,我自己掛上光盤,手動安裝解決了幾十的依賴關系,在配置些軟件時,還是經常報些依賴軟件包的缺失,很是頭疼,后來百度了下centos需要裝的編譯環境,在這里記錄下(使用yum安裝)
yum install gcc gcc-c++ gcc-g77 flex bison autoconf automake bzip2-devel zlib-devel ncurses-devel libjpeg-devel libpng-devel libtiff-devel freetype-devel pam-devel openssl-devel libxml2-devel gettext-devel pcre-devel,如果嫌麻煩的話,那就直接yum groupinstall "Development tools"
二。安裝NTFS-3G依賴FUSE的支持,所以先解壓安裝FUSE。
安裝FUSE命令:yum install fuse
1)下載ntfs-3g工具:http://www.tuxera.com/community/ntfs-3g-download/
下載完成 ntfs-3g_ntfsprogs-2014.2.15.tgz
2)解壓縮 tar -zxvf ntfs-3g_ntfsprogs-2014.2.15.tgz
解壓縮后進入文件夾ntfs-3g_ntfsprogs-2014.2.15
3)編譯並安裝
./configure
make
make install
4)查看USB設備點
[root@Chen ntfs-3g_ntfsprogs-2016.2.22]# fdisk -l
Disk /dev/sdb: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x33e90d24
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 64 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sdb2 64 14594 116707328 8e Linux LVM
Disk /dev/mapper/vg_chen-lv_root: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/mapper/vg_chen-lv_swap: 3187 MB, 3187671040 bytes
255 heads, 63 sectors/track, 387 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/mapper/vg_chen-lv_home: 62.6 GB, 62629347328 bytes
255 heads, 63 sectors/track, 7614 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x807f972d
Device Boot Start End Blocks Id System
/dev/sda1 1 38914 312569176 7 HPFS/NTFS
#fdisk -l (需要ROOT權限)
5)用root權限建立掛載點的文件目錄
[root@Chen ntfs-3g_ntfsprogs-2016.2.22]# mkdir /mnt/win
6)執行掛載命令
命令:mount -t ntfs-3g /dev/sda /mnt/win 執行后出現如下:
NTFS signature is missing.
Failed to mount '/dev/sda': 無效的參數
The device '/dev/sda' doesn't seem to have a valid NTFS.
Maybe the wrong device is used? Or the whole disk instead of apartition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?
命令:# mount -t ntfs-3g /dev/sda1 /mnt/win 執行后出現如下:
The disk contains an unclean file system (0, 0).
The file system wasn't safely closed on Windows. Fixing.
[root@Chen ntfs-3g_ntfsprogs-2016.2.22]#
進入 /mnt/win,發現掛載成功,沒有急,不過弄了一天了呵呵。
如果要開機自動掛載ntfs分區,需要更改/etc/fstab文件
用vi 打開fstab文件加入如下兩行
/dev/sda3 /mnt/windows/d ntfs-3g defaults 0 0
/dev/sda4 /mnt/windows/e ntfs-3g defaults 0 0
