GNU Parted 1.8.1
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p
Disk /dev/sda: 80.0GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
1 32.3kB 10.0GB 10.0GB primary ntfs boot
2 10.0GB 80.0GB 70.0GB extended lba
5 10.0GB 40.0GB 30.0GB logical fat32
6 40.0GB 62.5GB 22.5GB logical fat32
7 62.5GB 66.9GB 4409MB logical ext3
8 66.9GB 78.9GB 12.0GB logical ext3
9 78.9GB 80.0GB 1077MB logical linux-swap
Information: Don't forget to update /etc/fstab, if necessary.
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
/dev/sda1 * 1 1216 9767488+ 7 HPFS/NTFS
/dev/sda2 1217 9729 68380672+ f W95 Ext'd (LBA)
/dev/sda5 1217 4864 29302528+ b W95 FAT32
/dev/sda6 4865 7602 21992953+ b W95 FAT32
/dev/sda7 7603 8138 4305388+ 83 Linux
/dev/sda8 8139 9598 11727418+ 83 Linux
/dev/sda9 9599 9729 1052226 82 Linux swap / Solaris
[root@localhost /]#
举例:
Filesystem 容量 已用 可用 已用% 挂载点
/dev/hda8 11G 6.0G 4.4G 58% /
/dev/shm 236M 0 236M 0% /dev/shm
/dev/sda1 56G 22G 35G 39% /mnt/sda1
我们从中可以看到,系统安装在/dev/hda8 ;还有一个56G的磁盘分区/dev/sda1挂载在 /mnt/sda1中;
二、fdsik
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
/dev/hda1 * 1 765 6144831 7 HPFS/NTFS
/dev/hda2 766 2805 16386300 c W95 FAT32 (LBA)
/dev/hda3 2806 7751 39728745 5 Extended
/dev/hda5 2806 3825 8193118+ 83 Linux
/dev/hda6 3826 5100 10241406 83 Linux
/dev/hda7 5101 5198 787153+ 82 Linux swap / Solaris
/dev/hda8 5199 6657 11719386 83 Linux
/dev/hda9 6658 7751 8787523+ 83 Linux
System 表示的文件系统,比如/dev/hda1 是NTFS格式的;/dev/hda2 表示是fat32格式的文件系统;.
[root@localhost beinan]# fdisk -l
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
/dev/hda1 * 1 765 6144831 7 HPFS/NTFS
/dev/hda2 766 2805 16386300 c W95 FAT32 (LBA)
/dev/hda3 2806 7751 39728745 5 Extended
/dev/hda5 2806 3825 8193118+ 83 Linux
/dev/hda6 3826 5100 10241406 83 Linux
/dev/hda7 5101 5198 787153+ 82 Linux swap / Solaris
/dev/hda8 5199 6657 11719386 83 Linux
/dev/hda9 6658 7751 8787523+ 83 Linux
64 heads, 32 sectors/track, 57231 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
/dev/sda1 1 57231 58604528 83 Linux
[root@localhost beinan]# fdisk -l /dev/sda
64 heads, 32 sectors/track, 57231 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
/dev/sda1 1 57231 58604528 83 Linux
通过上面情况可以知道,在/dev/sda 这个磁盘中,只有一个分区;使用量差不多是百分百了;
比如
[root@localhost beinan]cfdisk -Ps /dev/hda
Partition Table for /dev/hda
# Type Sector Sector Offset Length Filesystem Type (ID) Flag
-- ------- ----------- ----------- ------ ----------- -------------------- ----
1 Primary 0 23438834 63 23438835 Linux (83) Boot
2 Primary 23438835 156296384 0 132857550 Extended (05) None
5 Logical 23438835 155268224 63 131829390 Linux (83) None
6 Logical 155268225 156296384 63 1028160 Linux swap (82) None
举例:
[root@localhost beinan]cfdisk /dev/hda
cfdisk 2.12a
Size: 80026361856 bytes, 80.0 GB
Heads: 255 Sectors per Track: 63 Cylinders: 9729
-------------------------------------------------------------------------------------------
hda1 Boot Primary Linux ReiserFS 12000.69
hda5 Logical Linux ReiserFS 67496.65
hda6 Logical Linux swap 526.42
[ Type ] [ Units ] [ Write ]
四、parted 功能不错的分区工具;
(parted) p
/dev/hda 的磁盘几何结构:0.000-76319.085 兆字节
磁盘标签类型:msdos
Minor 起始点 终止点 类型 文件系统 标志
1 0.031 6000.842 主分区 ntfs 启动
2 6000.842 22003.088 主分区 fat32 lba
3 22003.088 60800.690 扩展分区
5 22003.119 30004.211 逻辑分区 reiserfs
6 30004.242 40005.615 逻辑分区 reiserfs
7 40005.646 40774.350 逻辑分区 linux-swap
8 40774.381 52219.094 逻辑分区 ext3
9 52219.125 60800.690 逻辑分区 reiserfs
[root@localhost beinan]# sfdisk -l
自己看看吧;
七、partx 也简要的说一说,有些系统自带了这个工具,功能也简单,和fdisk 、parted、cfdisk 来说不值一提;不用也罢;
[root@localhost beinan]# partx /dev/hda
# 1: 63- 12289724 ( 12289662 sectors, 6292 MB)
# 2: 12289725- 45062324 ( 32772600 sectors, 16779 MB)
# 3: 45062325-124519814 ( 79457490 sectors, 40682 MB)
# 4: 0- -1 ( 0 sectors, 0 MB)
# 5: 45062388- 61448624 ( 16386237 sectors, 8389 MB)
# 6: 61448688- 81931499 ( 20482812 sectors, 10487 MB)
# 7: 81931563- 83505869 ( 1574307 sectors, 806 MB)
# 8: 83505933-106944704 ( 23438772 sectors, 12000 MB)
# 9: 106944768-124519814 ( 17575047 sectors, 8998 MB)
major minor #blocks name
3 1 6144831 hda1
3 2 16386300 hda2
3 5 8193118 hda5
3 6 10241406 hda6
3 7 787153 hda7
3 8 11719386 hda8
3 9 8787523 hda9
8 0 58605120 sda
8 1 58604528 sda1