Linux温馨提示1--安装U板块和Windwos划分
一、安装U盘
现在我用Ubuntu12.04在插入U光盘将被直接安装到/media/下,10:33linc@Linc-Ubuntu:linc$ df -h Filesystem 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:31linc@Linc-Ubuntu:linc$ lsusb Bus 001 Device 004: ID 04e8:681c Samsung Electronics Co., Ltd Galaxy Portal/Spica/S
2.fdisk查看磁盘名称
10:32linc@Linc-Ubuntu:linc$ sudo fdisk -l ... Disk /dev/sdb: 5354 MB, 5354029056 bytes 165 heads, 62 sectors/track, 1022 cylinders, total 10457088 sectors Units = sectors of 1 * 512 = 512 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 Disk /dev/sdc: 993 MB, 993001472 bytes 31 heads, 62 sectors/track, 1009 cylinders, total 1939456 sectors Units = sectors of 1 * 512 = 512 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从结果看出,手机有两个磁盘。一个手机自带的存储。一个是外加的SDCard。
3.mount
创建文件夹来放置挂载的文件sudo mkdir /mnt/usb挂载:
sudo mount /dev/sdc /mnt/usb/完成!
二、挂载Windows分区
原理同上,仅仅只是我们要找到Windows分区的磁盘名,例如以下:11:24linc@Linc-Ubuntu:~$ sudo fdisk -l Disk /dev/sda: 1000.2 GB, 1000204886016 bytes 255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk identifier: 0xf1eff1ef Device Boot Start End Blocks Id System /dev/sda1 * 63 204812684 102406311 7 HPFS/NTFS/exFAT Partition 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/exFAT Partition 5 does not start on physical sector boundary. /dev/sda6 724725760 1933993983 604634112 83 Linux /dev/sda7 1933996032 1953523711 9763840 82 Linux swap / SolarisHPFS/NTFS/exFAT的两个device就是Windows的分区,将当中一个mount进来也同U盘一样。
sudo mount /dev/sda5 /mnt/win sudo umount /mnt/win/开机自己主动挂载
我们仅仅须要在改动/etc/fstab文件就可以。加入例如以下内容:
#for the windows /dev/sda5 /mnt/win auto defaults 0 1
三、格式化U盘
格式化成Windows可以识别的格式。用fat吧。命令例如以下:
$ sudo fdisk -l ... Device Boot Start End Blocks Id System /dev/sdb1 * 32 31948799 15974384 c W95 FAT32 (LBA)
$ sudo umount /dev/sdb1 $ sudo mkfs -V -t vfat /dev/sdb1 mkfs (util-linux 2.20.1) mkfs.vfat /dev/sdb1 mkfs.fat 3.0.26 (2014-03-07)