实验8 存储管理(2)
时间:2025-07-09
时间:2025-07-09
划分分区需要有专门的分区工具。在安装Linux时,系统会提供专门工具供用户对磁盘分区。在已有系统中对磁盘(通常是新加的磁盘)进行分区需要另外其他其他工具。常用的分区工具是fdisk。
fdisk
功能:划分磁盘分区
格式:fdisk [选项] [磁盘设备文件]
选项:
-l:列出系统的磁盘个数和基本情况
例:列出当前的分区表信息,注意观察各分区的起始与结束的柱面(cylinders)编号。可知一个分区由一组连续的柱面组成。
#fdisk –l
Disk /dev/hda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 765 6144831 7 HPFS/NTFS
/dev/hda2 766 2805 16386300 c W95 FAT32 (LBA)
/dev/hda3 2806 9729 55617030 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
/dev/hda10 7752 9729 15888253+ 83 Linux
Disk /dev/sda: 1035 MB, 1035730944 bytes
256 heads, 63 sectors/track, 125 cylinders
Units = cylinders of 16128 * 512 = 8257536 bytes
Device Boot Start End Blocks Id System
/dev/sda1 1 25 201568+ c W95 FAT32 (LBA)
/dev/sda2 26 125 806400 5 Extended
/dev/sda5 26 50 201568+ 83 Linux
/dev/sda6 51 76 200781 83 Linux
例:编辑磁盘/dev/sda的分区表
fdisk /dev/sda
Command (m for help): 在这里按m ,就会输出帮助;
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
上一篇:土工格栅买卖合同