第一步:查看隨身碟資訊
首先使用 sudo fdisk -l 命令查看一下隨身碟在哪裡, 也就是隨身碟的掛載點在哪裡
(如果直接用fdisk -l命令,沒有出現任何結果,那麼就要加上sudo,以管理員身份來運行)
這個資訊查看後,可能會類似看到下面資訊:
Disk /dev/sda: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 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: 0x2076fe3d
Device Boot Start End Blocks Id System
/dev/sda1 * 1 3984 32001448+ 7 HPFS/NTFS
/dev/sda2 3985 30401 212194552+ f W95 Ext'd (LBA)
/dev/sda5 3985 11952 64002928+ b W95 FAT32
/dev/sda6 11953 19920 64002928+ b W95 FAT32
/dev/sda7 19921 30401 84188601 7 HPFS/NTFS
Disk /dev/sdc: 127 MB, 127139840 bytes
8 heads, 32 sectors/track, 970 cylinders
Units = cylinders of 256 * 512 = 131072 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/sdc1 1 970 124115 b W95 FAT32
Partition 1 has different physical/logical beginnings (non-Linux?):
phys=(0, 2, 0) logical=(0, 2, 27)
從最後面幾行可以看到隨身碟掛載在/dev/sdc1下,記住這個掛載點,這個掛載點會根據linux系統的不同,而有差別。
第二步:掛載隨身碟到指定節點
我們把 USB 磁碟機掛載在 /mnt/usb 目錄下 (上面我們可以看到是一個FAT32的格式的隨身碟)
# mount -t vfat /dev/sdc1 /mnt/usb
如果是 ntfs 格式的隨身碟,則類似如下:
# sudo mount -t ntfs-3g /dev/sdc1 /mnt/usb
/mnt/usb 為你要掛載到的節點,這個你可以隨便指定
之後你就可以通過 cd /mnt/usb 訪問隨身碟了。
第三步:卸載u盤
輸入命令:# sudo umount /mnt/usb 隨身碟卸載了(注意:此時不能夠在/mnt/usb目錄下輸入前面的卸載命令,否則系統會認為你的“裝置忙”而拒絕隨身碟的卸載)。