標籤:blog io ar os 使用 sp for strong 檔案
一、掛載隨身碟現在我用的Ubuntu12.04在插入隨身碟時會直接掛載到/media/下,
10:[email protected]:linc$ df -hFilesystem Size Used Avail Use% Mounted on/dev/sdc 947M 638M 310M 68% /media/72D2-11E2/dev/sdb 5.0G 1.5G 3.5G 31% /media/8221-13E3
但老古董如我的Fedora14卻不會這樣,所以我只有手動將其掛到/mnt/usb/下。
以我的三星手機為例,過程如下:
1.連上資料線,查看系統是否識別:
10:[email protected]:linc$ lsusbBus 001 Device 004: ID 04e8:681c Samsung Electronics Co., Ltd Galaxy Portal/Spica/S
2.fdisk查看磁碟名稱
10:[email protected]:linc$ sudo fdisk -l...Disk /dev/sdb: 5354 MB, 5354029056 bytes165 heads, 62 sectors/track, 1022 cylinders, total 10457088 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x00000000 Device Boot Start End Blocks Id SystemDisk /dev/sdc: 993 MB, 993001472 bytes31 heads, 62 sectors/track, 1009 cylinders, total 1939456 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x00000000 Device Boot Start End Blocks Id System
從結果看出,手機有兩個磁碟,一個手機內建的儲存,一個是外加的SDCard。
3.mount建立目錄來放置掛載的檔案
sudo mkdir /mnt/usb
掛載:
sudo mount /dev/sdc /mnt/usb/
完畢!
二、掛載Windows分區原理同上,只不過我們要找到Windows分區的磁碟名,如下:
11:[email protected]:~$ sudo fdisk -lDisk /dev/sda: 1000.2 GB, 1000204886016 bytes255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 4096 bytesI/O size (minimum/optimal): 4096 bytes / 4096 bytesDisk identifier: 0xf1eff1ef Device Boot Start End Blocks Id System/dev/sda1 * 63 204812684 102406311 7 HPFS/NTFS/exFATPartition 1 does not start on physical sector boundary./dev/sda2 204812746 1953523711 874355483 f W95 Ext‘d (LBA)Partition 2 does not start on physical sector boundary./dev/sda5 204812748 724724279 259955766 7 HPFS/NTFS/exFATPartition 5 does not start on physical sector boundary./dev/sda6 724725760 1933993983 604634112 83 Linux/dev/sda7 1933996032 1953523711 9763840 82 Linux swap / Solaris
HPFS/NTFS/exFAT的兩個device就是Windows的分區,將其中一個mount進來也同隨身碟一樣,
sudo mount /dev/sda5 /mnt/winsudo umount /mnt/win/
開機自動掛載
我們只需要在修改/etc/fstab檔案即可,添加如下內容:
#for the windows/dev/sda5 /mnt/win auto defaults 0 1
Linux提示1--掛載隨身碟和Windwos分區