一、分区原理
1、主分区表(64byte):记录分区的起始与结束柱面、主分区个数。主分区大小有限,不能超过四个主分区
2、扩展分区:将一个主分区更改成扩展分区,扩展分区支持无限个分区(逻辑分区),逻辑分区的信息写在扩展分区表中。
二、格式化原理
也就是创建不同的文件系统,供数据的存储与读取。
常用的linux分区工具:fdisk,sfdisk,diskdruid
Linux基础分区和格式化
root@localhost Desktop]# fdisk -l
[root@localhost Desktop]# fdisk /dev/vdb
Command (m for help): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
g create a new empty GPT partition table
G create an IRIX (SGI) partition table
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)
[root@localhost Desktop]# partprobe #同步文件系统与硬盘
[root@localhost Desktop]# cat /proc/partitions
#######开机时自动挂载设置
[root@localhost Desktop]# vim /etc/fstab #文件的自动挂载
[root@localhost Desktop]# df
[root@localhost Desktop]# mount -a #####同步/etc/fstab中没有挂载的
[root@localhost Desktop]# df