
正文
linux建立表分区命令 要建立linux分区可以有哪几种方法
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
Linux创建2TB以上分区,以及正确的对齐磁盘
一般来说,Linux创建分区使用fdisk命令,可以自动对齐磁盘。然而,fdisk无法处理大于2TB的磁盘文件。这种情况下,需要使用parted命令去创建分区。
parted创建分区需要手动指定分区开始与结束位置,可能会面临磁盘不对齐的问题(提示:Warning: The resulting partition is not properly aligned for best performance.)
所以需要手动去计算分区起点来对齐磁盘。
输入0.00T有时候可以免于计算起点
所以分区命令是
检查是否正确对齐
如果还有问题,则需要进一步修正,可以参考
相关问答
Q1: 在linux系统中下列哪个命令可用来建立分区
Linux下常用的分区工具linux建立表分区命令:
fdisk/sfdisk:命令行工具,各种版本和环境都能使用,包含在软件包util-linux中
diskdruid:图形化分区工具,只能在安装REDHAT系统时使用。
第一步:fdisk
[root@novice ~]# fdisk -l /dev/sdb
Disk /dev/sdb: 254 MB, 254017536 bytes
8 heads, 61 sectors/track, 1016 cylinders, total 496128 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
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
[root@novice ~]# fdisk /dev/sdb
Command (m for help): #在输入上面的命令后会出现左边的提示,输入m就会得到一个帮助菜单,如下:
Command (m for help): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
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)
#help虽然是英文的,可都很简单,在这里不再解释。
#现在,linux建立表分区命令我们正式开始分区的操作:
Command (m for help): n #新建分区
Command action
e extended
p primary partition (1-4)
#e/p分别对应扩展分区 /主分区linux建立表分区命令;linux建立表分区命令我们先分四个主分区,每个50M;然后再来增加主分区或扩展分区,看会出现怎样的状况,嘿嘿。
p #分区类型为主分区
Partition number (1-4, default 1): 1 #分区号,在这里我们依次选择1、2、3、4
First sector (2048-496127, default 2048): #指定分区的起始扇区,一般默认,按enter键即可。
Last sector, +sectors or +size{K,M,G} (2048-496127, default 496127): +50M #指定分区的终止扇区,根据前面的提示我们可以做出相应的选择+sectors 或 +size{K,M,G}
Command (m for help): p #用p打印出已建好的分区列表
Disk /dev/sdb: 254 MB, 254017536 bytes
8 heads, 61 sectors/track, 1016 cylinders, total 496128 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
Disk identifier: 0x00000000
Q2: linux添加新硬盘怎么做 要如何分区
1、1、关机状态下将硬盘装在电脑上,重启电脑,后查看/dev/ 下有没多了一块硬盘。
2、2、用fdisk对这块硬盘分区fdisk /dev/sdb(sdb代指新硬盘盘符,有可能是别的)
3、3、按下m显示分区命令菜单,可以用m命令来看fdisk命令的内部命令;n命令创建一个新分区;d命令删除一个存在的分区;p命令显示分区列表;t命令修改分区的类型ID号;l命令显示分区ID号的列表;a命令指定启动分区;w命令是将对分区表的修改存盘让它发生作用。
4、我们这里是创建新分区,所以输入 n 然后 e 是扩展分区,p 是主分区,我们输入 p
5、接下来的块数什么的,都输入 1 ,最后选择大小,Last cylinder or +size or +sizeM or +sizeK (1-60801, default 60801): +500GB //我们输入这个意思是分区大小为500G
6、最后输入 w 保存。
关于linux建立表分区命令和要建立linux分区可以有哪几种方法的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站。








