安装CentOS时磁盘分配是一个非常重要的步骤,这决定了系统的磁盘使用情况。一般情况下,CentOS会自动分配磁盘分区,但是对于一些需要特殊设置的系统,手动分配磁盘分区就显得非常必要。
在CentOS中,我们可以使用fdisk命令进行分区操作。下面是一个简单的分区示例:
首先,我们需要登录CentOS系统,打开终端进行操作。
输入fdisk -l命令,查看已有的分区列表。
[root@localhost ~]# fdisk -l
Disk /dev/sda: 25.8 GB, 25769803776 bytes, 50331648 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 label type: dos
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 1026047 512000 83 Linux
/dev/sda2 1026048 50331647 24652700 8e Linux LVM
Disk /dev/mapper/centos-root: 21.5 GB, 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
Disk /dev/mapper/centos-swap: 4194 MB, 4194304000 bytes, 8192000 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
我们可以看到,已有两个分区/dev/sda1和/dev/sda2。
输入fdisk /dev/sda命令,对磁盘进行分区。
[root@localhost ~]# fdisk /dev/sda
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): n
Partition type:
p primary (0 primary,
上一篇:安装centos时不分区安装
下一篇:安装centos时错误日志文件