-
Allocate disk
-
View hard drive mount
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
-
Try to mount /dev/sda to /home_expand
If errors are reported, view the current device being mounted file system type
df -h -T
,
and then format the / dev / sda
if the other hard drive isext3
, use themkfs.ext3 /dev/sda
format
if the other hard drive isext4
, use themkfs.ext4 /dev/sda
format
to mount again,mount /dev/sda /home_expand
this time as a temporary mount. -
Change to mount a long-term, you need to
vim /etc/fstab
file added to the end/dev/sda /home_expand ext4 defaults 1 2
Click to jump: If you don’t understand the content of fstab, be sure to look at the detailed fstab content
- At this point, the mounting is complete, you can try
reboot