sda 「 硬盘 」
sda1 「 分区」
sda2 「 一块硬盘多个分区」
sda3
sda4 「 主分区最多4个」
boot 「 引导分区 」
硬盘分为block组,每组block由super block + 文件描述系统 + block位图 + inode位图 + inode +block格
super block 「 inode 信息 和 block总量 & 剩余 」
文件描述系统 「 一个innode 128B 记录一个文件 & 文件的属性:ugo & 位置 & mtime 」
block对照表 「 4k的块 」
ext3 日志功能
ext3 ext2 vfat 「 文件系统 」
vfs 「 虚拟文件系统 」
df -hT「 disk file & -h human -T type 」
du -sh /etc/ 「 文件夹大小 & -s summarize 」
fdisk -l 「 查看所有硬盘和分区」
fdisk -l /dev/sda2
fdisk /dev/sda 「 对硬盘分区」
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)
partprobe /dev/sda 「 更新硬盘分区表 」
partprobe 「 更新所有硬盘 」
mkfs -t ext3 /dev/sda5 = mkfs.ext3 /dev/sda5 「 格式化分区 」
mount /dev/sda5 /mnt 「 挂载 」
fsck -f /dev/sda1 「 强制分区自检 」
badblocks -sv /dev/sda1 「 坏道检查 」