机械硬盘
以一圈为以单位
head(512K)
磁盘:电脑只有一块,但Windows一般分为c: d: e:
BIOS 基础输入输出设备
446——引导代码
16*4 分区表
55 AA_代表可启
MBL占磁盘的前512
逻辑分区基于扩展分区
扩展分区不能用,在扩展分区建立逻辑分区,就可以创建更多的分区
UEFI是取代BIOS的新引导系统
分区:
创建分区
root@kongxiu-PC:/home/kongxiu/Desktop# fdisk -l
Disk /dev/sda: 20 GiB, 21474836480 bytes, 41943040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xd11f6a22
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 41943039 41940992 20G 83 Linux
root@kongxiu-PC:/home/kongxiu/Desktop#
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 41943039 41940992 20G 83 Linux
fdisk
root@kongxiu-PC:~# fdisk /dev/sda1
Welcome to fdisk (util-linux 2.29.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device /dev/sda1 already contains a ext4 signature.
The signature will be removed by a write command.
Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0xc2343779.
Command (m for help):
Command (m for help): m
Help:
DOS (MBR)
a toggle a bootable flag
b edit nested BSD disklabel
c toggle the dos compatibility flag
Generic
d delete a partition ——删除一个分区
F list free unpartitioned space
l list known partition types
n add a new partition ——创建一个新的分区
p print the partition table ——输出分区
t change a partition type——改变一个分区的类型
v verify the partition table——修改分区
i print information about a partition——输出分区的信息
Misc
m print this menu
u change display/entry units
x extra functionality (experts only)
Script
I load disk layout from sfdisk script file
O dump disk layout to sfdisk script file
Save & Exit
w write table to disk and exit ——保存操作
q quit without saving changes ——退出不保存
Create a new label
g create a new empty GPT partition table
G create a new empty SGI (IRIX) partition table
o create a new empty DOS partition table
s create a new empty Sun partition table
Device Boot Start End Sectors Size Id Type
/dev/sda1p2 2048 41940991 41938944 20G 5 Extended
/dev/sda1p5 4096 4096 1 512B 83 Linux
root@kongxiu-PC:~# ls /dev/sda1
/dev/sda1
root@kongxiu-PC:~# ls /dev/sda*
/dev/sda /dev/sda1
root@kongxiu-PC:~# partprobe #partprobe命令可以使kernel重新读取分区信息
Warning: Unable to open /dev/sr0 read-write (只读文件系统). /dev/sr0 has been opened read-only.
Warning: Unable to open /dev/sr0 read-write (只读文件系统). /dev/sr0 has been opened read-only.
Warning: Unable to open /dev/sr0 read-write (只读文件系统). /dev/sr0 has been opened read-only.
root@kongxiu-PC:~# ls /dev/sda*
/dev/sda /dev/sda1
Warning: Unable to open /dev/sr0 read-write (只读文件系统). /dev/sr0 has been opened read-only.
/dev/sr0是你的光驱(CD Drive),因为你运行partprobe时没有指定设备,所以它会检查所有的块设备(block devices),由于光驱是read-only,所以报上述告警信息,其实避免这个错误也很简单,你只需要使用partprobe检查、扫描指定设备即可。
partprobe dev/sdo
文件系统:
fat32 、NTFS——Windows
ext2、ext3、ext4——Linux
xfs——以其性能和可扩展性著称
创建文件系统(格式化)
1、无文件系统称为裸设备
不同的Linux系统版本支持的文件系统不一样