Hi!请登陆

用fdisk创建分区的方法

2020-10-27 63 10/27

linux的服务器一般都是没有图形界面的,
所以如果我们添加了新硬盘需要分区就只能使用fdisk在文本界面操作了.
这篇文章就是演示一个完整的分区过程,下面开始:

$fdisk /dev/hdb //准备为 hdb 建立分区
The number of cylinders for this disk is set to 20805.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): n //键入 n 表示要建立分区
Command action
e extended
p primary partition (1-4)
p //键入 p 表示建立主要分区
Partition number (1-4): 1 //键入 1 为此主要分区代号
First cylinder (1-20805, default 1): //开始磁柱值,按下 enter 即可
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-20805, default 20805): //结束磁柱值,按下 enter 即可
Using default value 20805
Command (m for help): w //键入 w 表示确定执行刚才设定
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@node1 yum.repos.d]$ partprobe //使刚才的 partition table 变更生效
Tag:

相关推荐