今天我给大家讲讲LINUX中的分区,格式化,挂载安全
在WINDOW里分区和格式化是分不开的,在LINUX中也是同样的.
LINUX中也是只能分为4个主分区.
现在我们来做个分区和格式化的例子
1,用fdisk -l 来看看我们的硬盘情况
Disk /dev/sda: 8589 MB, 8589934592 bytes 255 heads, 63 sectors/track, 1044 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System /dev/sda1 * 1 26 208813 83 Linux /dev/sda2 27 918 7164990 83 Linux /dev/sda3 919 951 265072 82 Linux swap
Disk /dev/sdb: 8589 MB, 8589934592 bytes 255 heads, 63 sectors/track, 1044 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
Disk /dev/sdc: 8589 MB, 8589934592 bytes 255 heads, 63 sectors/track, 1044 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdc doesn''t contain a valid partition table
Disk /dev/sdd: 8589 MB, 8589934592 bytes 255 heads, 63 sectors/track, 1044 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdd doesn''t contain a valid partition table
可以看出来我们有4块硬盘./dev/sda 已经分好区了
我们拿/dev/sdb 来做分区的实验.
2:fdisk /dev/sdb
出现 The number of cylinders for this disk is set to 1044. There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with: 1) software that runs at boot time (e.g., old versions of LILO) 2) booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK)
Command (m for help):
3:在Command (m for help): 输入m m(帮助)出现
a toggle a bootable flag b edit bsd disklabel c toggle the dos compatibility flag d delete a partition l list known partition types m print this menu n add a new partition o create a new empty DOS partition table p print the partition table q quit without saving changes s create a new empty Sun disklabel t change a partition''s system id u change display/entry units v verify the partition table w write table to disk and exit x extra functionality (experts only)
在这里我们说几个常用的参数:
d delete a partition(删除一个分区) n add a new partition(添加一个分区) p print the partition table(打印分区的情况) t change a partition''s system id(转换分区系统编号) w write table to disk and exit(写入并且保存分区) q quit without saving changes(退出但不保存) l list known partition types(建立逻辑分区) v verify the partition table(验证分区还剩多少磁盘没分)
3:输入 N 来建立一个主分区
出现 Command action e extended p primary partition (1-4)
选P的话是说明建立主分区,只能建立4个主分区; 选e 说明建立扩展分区.
4:输入 P 出现 Partition number (1-4): 这步让我们来添加分区的编号我们在这里输入1
5:Partition number (1-4):1 按回车 出现 First cylinder (1-1044, default 1): 这步是说名我的磁盘有1024个柱面,我们在这里面按回车默认.
出现Last cylinder or size or sizeM or sizeK (1-1044, default 1044):
让我们在1-1024个柱 |