linode添加块存储教程参考:linode Block Storage添加块存储磁盘教程
如果要我建议的话,当然还是建议根据自己的需求,购买对应的linode套餐,因为默认的套餐磁盘是SSD。个别客户又想要大的磁盘做存储,又不舍得投入更多的钱购买更高配置的SSD,那买低配的linode套餐,然后额外附加一个块存储也是可以的。
下面简单说下教程。老易特意买了个日本VPS,linode日本机房的弄个教程。找易秋网络老易代购linode的话,我这可以免费帮挂载好额外添加的块存储,其实也就是额外挂载下添加的磁盘。
比如默认最低配的是25G磁盘,额外买一块160G的块存储。
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
添加linode块存储后,格式化添加的磁盘,挂载添加的磁盘,并且设置好开机挂载好磁盘:
Volume scheduled for creation.
To get started with a new volume, you'll want to create a filesystem on it:
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"
If you want the volume to automatically mount every time your Linode boots, you'll want to add a line like the following to your /etc/fstab file:
/dev/disk/by-id/scsi-0Linode_Volume_block2689 /mnt/block2689 ext4 defaults,noatime,nofail 0 2
可以敲命令fdisk -l看看,是多了一块160G的磁盘:
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
看看挂载好磁盘的磁盘分区情况:
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
/dev/sdc 157G 61M 149G 1% /mnt/block2689