Disk Info
To purchase a cloud disk of 10GB and mount it to the path of /dev/vdb.
sudo fdisk -l /dev/vdb
:
Disk /dev/vdb: 10 GiB, 10737418240 bytes, 20971520 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
How to Partition
- run
sudo fdisk /dev/vdb
, then type like below:
> 'n' > 'p' > Enter > Enter > Enter > '+8G'
> 'n' > 'p' > Enter > Enter > Enter > Enter
> 'w'
- run
sudo fdisk -l /dev/vdb
:
Disk /dev/vdb: 10 GiB, 10737418240 bytes, 20971520 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: 0xae714a6c
Device Boot Start End Sectors Size Id Type
/dev/vdb1 2048 16779263 16777216 8G 83 Linux
/dev/vdb2 16779264 20971519 4192256 2G 83 Linux
How to Format
- format the lfs partition:
sudo mkfs -v -t ext4 /dev/vdb1
- format the swap partition:
sudo mkswap /dev/vdb2
How to Mount
- run
export LFS=/mnt/lfs
to set the $LFS variable - run
sudo mkdir -pv $LFS
to create the /mnt/lfs directory - run
sudo mount -v -t ext4 /dev/vdb1 $LFS
to mount the /dev/vdb1 partition to /mnt/lfs - run
sudo /sbin/swapon -v /dev/vdb2
to use the /dev/vdb2 swap partition