当前位置:网站首页>Disk management and file systems
Disk management and file systems
2022-08-05 06:15:00 【sologuai】
一、磁盘概述
Three elements of disk physics:
扇区:盘片被分为多个扇形区域,每个扇区存放512字节的数据,硬盘的最小存储单位
磁道: 同一盘片不同半径的同心圆, 是由磁头在盘片表面划出的圆形轨迹,方便数据存储
柱面: 不同盘片相同半径构成的圆柱面,由同一半径圆的多个磁道组成
二、mbr
- MBR位于硬盘第一个物理扇区处 , MBR中包含硬盘的主引导程序和硬盘分区表
- 第一个扇区总共512字节,前446字节是主引导记录,分区表保存在扇区中的第447-512字节中.
- 分区表有4个分区记录区,每个分区记录区占16字节.
- The last two bytes are the flag bits
表示:/dev/hda5
- /dev/:硬件设备文件所在的目录
- hd:表示IDE设备(sd表示scsi设备)
- a:硬盘的顺序号,表示的第几块硬盘,以a、b、c…表示
- 5:分区的顺序号,表示第一块硬盘接口的第五个分区
磁盘分区结构
- 硬盘中的主分区数目只有4个
- 主分区和扩展分区的序号限制在1 ~4
- 扩展分区再分为逻辑分区
- 逻辑分区的序号将始终从5开始
三、Linux中使用的文件系统类型
- XFS文件系统
- Swap交换文件系统 (虚拟内存)
- FAT16、FAT32
- NTFS
- EXT4(Extended file system 4, 第四代扩展文件系统 )
- JFS
四、A partition tool for managing disksfdsik
fdisk -l [磁盘设备] //非交互式查看磁盘分区
fdisk [磁盘设备] //交互式查看和管理磁盘分区
- m 打印出菜单(帮助列表)
- p 打印出当前分区表
- n 新建一个分区
- d 删除一个分区
- t 改变分区的格式和系统ID
- w 保存
- q 退出
[[email protected] ~]# fdisk /dev/sda //交互式查看和管理磁盘分区 欢迎使用 fdisk (util-linux 2.23.2). 更改将停留在内存中,直到您决定将更改写入磁盘. 使用写入命令前请三思. 命令(输入 m 获取帮助):m //m指令打印出菜单 命令操作 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) 命令(输入 m 获取帮助):p //p指令打印出当前分区表 磁盘 /dev/sda:64.4 GB, 64424509440 字节,125829120 个扇区 Units = 扇区 of 1 * 512 = 512 bytes 扇区大小(逻辑/物理):512 字节 / 512 字节 I/O 大小(最小/最佳):512 字节 / 512 字节 磁盘标签类型:dos 磁盘标识符:0x000c4763 设备 Boot Start End Blocks Id System /dev/sda1 * 2048 2099199 1048576 83 Linux /dev/sda2 2099200 31467519 14684160 8e Linux LVM 命令(输入 m 获取帮助):q //q指令退出
五、创建文件系统(格式化)
创建文件系统mkfs命令
mkfs.文件系统类型 分区设备 //分区设备位置都要用绝对路径
[[email protected] ~]# mkfs.xfs /dev/sdb1 //将sdb1格式化为XFS文件系统
meta-data=/dev/sdb3 isize=512 agcount=4, agsize=655360 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=0, sparse=0
data = bsize=4096 blocks=2621440, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =internal log bsize=4096 blocks=2560, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
六、挂载和卸载
挂载——mount命令
mount [-t 文件系统类型] 存储设备 挂载点目录
注意:
- 挂载目录需事先存在,不能挂载不存在的目录.
- 最好挂载空目录,不然挂载点下原有文件可能丢失或被隐藏.
- 挂载点目录不可被其他进程使用到.
- 一个目录不能同时挂载多个设备.
- 一个分区设备不能同时挂载到多个目录下.
解挂载——umount命令
umount 存储设备位置
边栏推荐
- Hard Disk Partitioning and Permanent Mounting
- 实力卷王LinkSLA,实现运维工程师快乐摸鱼
- 入门文档09 独立的watch
- In-depth Zabbix user guide - from the green boy
- [Day1] VMware software installation
- spark算子-repartition算子
- Configuration of TensorFlow ObjecDetectionAPI under Anaconda3 of win10 system
- Spark source code - task submission process - 4-container to start executor
- spark source code-RPC communication mechanism
- Mongodb查询分析器解析
猜你喜欢
静态路由
Getting Started 05 Using cb() to indicate that the current task is complete
ALC实验
network issue?Service packet loss?This is enough
深度 Zabbix 使用指南——来自惨绿少年
VRRP principle and command
I/O performance and reliability
Getting Started Documentation 12 webserve + Hot Updates
账号与权限管理
The problem of calling ds18b20 through a single bus
随机推荐
监控系统的内卷,有什么讲究?
King power volume LinkSLA, realize operations engineer is happy fishing
Getting Started 04 When a task depends on another task, it needs to be executed in sequence
LeetCode Interview Questions
IP packet format (ICMP protocol and ARP protocol)
【Day8】使用LVM扩容所涉及的命令
spark算子-wholeTextFiles算子
[Paper Intensive Reading] The relationship between Precision-Recall and ROC curves
图片压缩失效问题
【Day6】文件系统权限管理 文件特殊权限 隐藏属性
What impact does CIPU have on the cloud computing industry?
运维工程师,快来薅羊毛
lvm logical volume and disk quota
Switch principle
dsf5.0新建页面访问时重定向到首页的问题
spark operator-parallelize operator
Technology Sharing Miscellaneous Technologies
CIPU, what impact does it have on the cloud computing industry?
Getting Started Documentation 12 webserve + Hot Updates
入门文档05-2 使用return指示当前任务已完成