2 創(chuàng)建分區(qū)并裝載

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
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容