2 创建分区并装载

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

  1. run sudo fdisk /dev/vdb , then type like below:
> 'n' > 'p' > Enter > Enter > Enter  > '+8G'
> 'n' > 'p' > Enter > Enter > Enter  > Enter 
> 'w'
  1. 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

  1. format the lfs partition:
    sudo mkfs -v -t ext4 /dev/vdb1
  2. format the swap partition:
    sudo mkswap /dev/vdb2

How to Mount

  1. run export LFS=/mnt/lfs to set the $LFS variable
  2. run sudo mkdir -pv $LFS to create the /mnt/lfs directory
  3. run sudo mount -v -t ext4 /dev/vdb1 $LFS to mount the /dev/vdb1 partition to /mnt/lfs
  4. run sudo /sbin/swapon -v /dev/vdb2 to use the /dev/vdb2 swap partition
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容