root@chenzhijun-lnx:/etc# fdisk -l
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 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: 0x2b1f5620
Device Boot Start End Blocks Id System /dev/sda1 1 5100 40965718+ 7 HPFS/NTFS
/dev/sda2 * 5101 9016 31455270 83 Linux
/dev/sda3 9017 35623 213720727+ 83 Linux
/dev/sda4 35624 60801 202242254+ f W95 Ext'd (LBA)
/dev/sda5 35624 60801 202242253+ 7 HPFS/NTFS
说明:/dev/sda1 /dev/sda4 /dev/sda5 是给Windows用的,其中/dev/sda4是“徒有虚名”的“总体抽象的”扩展分区,只是一个“链接”,不能具体地mount
/dev/sda2 /dev/sda3 是给linux用的,没有扩展分区,千万不要把/dev/sda4当作扩展分区
另外,我的DELL机的分区情况为:
root@super:media# fdisk -l
Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 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: 0xf0b1ebb0
Device Boot Start End Blocks Id System
/dev/sda1 1 1959 15735636 7 HPFS/NTFS
/dev/sda2 1960 9729 62412494+ 5 Extended
/dev/sda5 * 1960 3265 10490413+ 83 Linux
/dev/sda6 3266 5224 15735636 83 Linux
/dev/sda7 5225 5486 2104483+ 82 Linux swap / Solaris
/dev/sda8 5487 9729 34081866 83 Linux
只有/dev/sda1是给windows用的,/dev/sda2是抽象的扩展分区, /dev/sda5 /dev/sda6 /dev/sda7 /dev/sda8 是给linux用的,其中 /dev/sda7是交换分区
另:/etc/fstab被删,急救方法:
(1) cp /etc/mtab /etc/fstab
Notes:mtab里记录了系统当前的mount情况,而fstab记录的是系统启动时默认的mount方式。
(2)修改fstab,去掉多余mount信息,只保留 proc 和 根目录“/”、home 的行
(3)将mount在根目录的那一项的最后的0改成1,将mount在home的项的最后的0改成2
(4)若有swap分区,在fstab里添加一项swap的项(参考其他linux机器)
(5)将形如 /dev/sda* 改成形如 UUID=...
UUID的对应方法方法:ls /dev/disk/by-uuid -al
本文出自 “星君天子的博客” 博客,谢绝转载!