ICode9

精准搜索请尝试: 精确搜索
首页 > 系统相关> 文章详细

Linux 磁盘管理

2021-11-22 10:03:12  阅读:148  来源: 互联网

标签:Linux 1.1 管理 分区 partition part table 磁盘 disk


Linux 磁盘管理

# 为什么服务器中有10块硬盘,在 linux 系统中显示少于10块的情况
答:因为系统盘做了 raid 将几块数据盘做成了一块,用与防止某一块数据盘损坏导致数据丢失。
	sda sdb sdc sde 指的就是
# 系统分区是在作什么?
答:系统分区是指在一块硬盘中化一个到四个分区,类似 windows 中的 C 盘、D盘、 E盘

# 分区完成之后 /dev 文件夹下就会多了一个 /sde1 /sde2 /sde3 
# 给磁盘进行分区
$ fdisk /dev/sde

Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): m #输入 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)

Command (m for help): n  							# 创建主分区
Partition type:
   p   primary (2 primary, 0 extended, 2 free)		# 主分区最多有四个
   e   extended
Select (default p): p 								# 选择 p 模式
Partition number (3,4, default 3): 
First sector (734005248-2343174143, default 734005248): 734005248  						# 从指定扇区开始
Last sector, +sectors or +size{K,M,G} (734005248-2343174143, default 2343174143): +300G # 主分区大小
Partition 3 of type Linux and of size 300 GiB is set
	
Command (m for help): w  							# 保存并退出
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
$ lsblk # 查看磁盘分区
[root@controller1 ~]# lsblk
NAME              MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                 8:0    0 558.4G  0 disk 
├─sda1              8:1    0   200M  0 part /boot/efi
├─sda2              8:2    0     1G  0 part /boot
└─sda3              8:3    0 557.2G  0 part 
  ├─centos00-root 253:0    0 553.2G  0 lvm  /
  └─centos00-swap 253:1    0     4G  0 lvm  [SWAP]
sdb                 8:64   0   1.1T  0 disk 
sdc                 8:64   0   1.1T  0 disk 
sdd                 8:64   0   1.1T  0 disk 
sde                 8:64   0   1.1T  0 disk 
├─sde1              8:65   0    50G  0 part  
└─sde2              8:66   0   300G  0 part 
├─sde3              8:65   0    50G  0 part 
└─sde4              8:66   0   300G  0 part 
nvme0n1           259:0    0 745.2G  0 disk 
└─nvme0n1p1       259:1    0 745.2G  0 part

标签:Linux,1.1,管理,分区,partition,part,table,磁盘,disk
来源: https://www.cnblogs.com/FutureHolmes/p/15587215.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有