linux 系統掛載雲盤的方法

Saturday, May 9, 2020 | 1 minute read | Updated at Saturday, May 9, 2020

@

linux 系統掛載雲盤的方法

適用於一些雲供應商,提升硬盤容量

查看硬盤分區信息

fdisk -l
Disk /dev/vda: 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: 0x6385f4f5

Device     Boot    Start      End  Sectors  Size Id Type
/dev/vda1  *        2048 19920511 19918464  9.5G 83 Linux
/dev/vda2       19920512 20969087  1048576  512M 82 Linux swap / Solaris


Disk /dev/sda: 256 GiB, 274877906944 bytes, 536870912 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

此處需要掛載的是/dev/sda硬盤

格式化/dev/sda硬盤

mkfs.ext4 /dev/sda

掛載/dev/sda硬盤到指定目錄

mount -t ext4 /dev/sda /home/wwwroot

開機掛載硬盤分區 vi /etc/fstab

/dev/sda /home/wwwroot ext4 defaults 0 0

© 2018 - 2026 vpslala

🌱 Powered by Hugo with theme Dream.