2 创建分区并装载

2018-05-12  本文已影响0人  RTsien

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
上一篇 下一篇

猜你喜欢

热点阅读