admin avatar

linux 系統掛載雲盤的方法

🕐 by admin





linux 系統掛載雲盤的方法

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

查看硬盤分區信息

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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





💘 相关文章





写一条评论

Based on Golang + fastHTTP + sdb | go1.18.1 Processed in 2ms