linode Block Storage添加块存储磁盘教程

如果要我建议的话,当然还是建议根据自己的需求,购买对应的linode套餐,因为默认的套餐磁盘是SSD。个别客户又想要大的磁盘做存储,又不舍得投入更多的钱购买更高配置的SSD,那买低配的linode套餐,然后额外附加一个块存储也是可以的。

下面简单说下教程。老易特意买了个日本VPS,linode日本机房的弄个教程。找易秋网络老易代购linode的话,我这可以免费帮挂载好额外添加的块存储,其实也就是额外挂载下添加的磁盘。

先看看没添加块存储的情况:

root@li1721-227:~# df -h
Filesystem Size Used Avail Use% Mounted on
udev 480M 0 480M 0% /dev
tmpfs 99M 12M 88M 12% /run
/dev/sda 25G 1.1G 22G 5% /
tmpfs 494M 0 494M 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 494M 0 494M 0% /sys/fs/cgroup
tmpfs 99M 0 99M 0% /run/user/0

然后:

先找到想要添加磁盘的linodes,然后点添加块存储。

添加后,其实就是多了一块磁盘

root@li1721-227:~# fdisk -l
Disk /dev/sda: 24.5 GiB, 26306674688 bytes, 51380224 sectors
Disk model: QEMU HARDDISK
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/sdb: 512 MiB, 536870912 bytes, 1048576 sectors
Disk model: QEMU HARDDISK
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/sdc: 160 GiB, 171798691840 bytes, 335544320 sectors
Disk model: Volume
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

格式化磁盘:mkfs.ext4 “/dev/disk/by-id/scsi-0Linode_Volume_block2689”

挂载磁盘:

Once the volume has a filesystem, you can create a mountpoint for it:
mkdir “/mnt/block2689”

Then you can mount the new volume:
mount “/dev/disk/by-id/scsi-0Linode_Volume_block2689” “/mnt/block2689”

修改/etc/fstab文件,也就是说开机自动挂载磁盘

/dev/disk/by-id/scsi-0Linode_Volume_block2689 /mnt/block2689 ext4 defaults,noatime,nofail 0 2

挂载好添加的磁盘,也就是显示的/dev/sdc,有160G

然后网上有人吐槽说linode额外添加的磁盘,磁盘性能不行。当然没有默认的SSD磁盘读取速度好,但是其实也是不错的。比别的商家的磁盘读取速度还是好上一截的。

One thought on “linode Block Storage添加块存储磁盘教程

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.