Linux基础——磁盘,分区,挂载

机械硬盘
在这里插入图片描述
在这里插入图片描述
以一圈为以单位
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系统版本支持的文件系统不一样
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值