-
分配磁盘
-
查看硬盘挂载
fdisk -l root@desktop:/home/user1# fdisk -l Disk /dev/vda: 30 GiB, 32212254720 bytes, 62914560 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 Disklabel type: dos Disk identifier: 0x4f6e894a Device Boot Start End Sectors Size Id Type /dev/vda1 * 2048 37750783 37748736 18G 83 Linux /dev/vda2 37750784 37752829 2046 1023K 83 Linux /dev/vda3 37752830 41940991 4188162 2G 5 Extended /dev/vda5 37752832 41940991 4188160 2G 82 Linux swap / Solaris Disk /dev/vdb: 1 GiB, 1073741824 bytes, 2097152 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/sda: 50 GiB, 53687091200 bytes, 104857600 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/sda 到 /home_expand
如果报错,查看当前被挂载设备文件系统类型
df -h -T
,
再格式化/dev/sda
如果其他硬盘是ext3
, 则使用mkfs.ext3 /dev/sda
进行格式化
如果其他硬盘是ext4
, 则使用mkfs.ext4 /dev/sda
进行格式化
再次挂载mount /dev/sda /home_expand
此时为临时挂载。 -
更改为长期挂载,需要
vim /etc/fstab
文件末尾添加/dev/sda /home_expand ext4 defaults 1 2
点击跳转:如果不理解 fstab 内容,一定要看一下详解fstab内容
- 至此挂载完成,可以尝试
reboot