BuyVM Block Storage(数据盘)挂载方法

@admin  May 26, 2020

1、购买 Block Storage (Las Vegas)。
2、进入 Storage Volumeshttps://manage.buyvm.net/volumes/)后台,将 Block Storage 附加到(Attached To) VPS。

buyvm管理后台

3、登陆服务器查看附加卷

[root@localhost ~]# ls /dev/disk/by-id/
ata-QEMU_DVD-ROM_QM00004  scsi-0BUYVM_SLAB_VOLUME-2587

4、格式化附加卷

[root@localhost ~]# mkfs.ext4 -F /dev/disk/by-id/scsi-0BUYVM_SLAB_VOLUME-2587

5、挂载附加卷

[root@localhost ~]# mkdir /data 
[root@localhost ~]# mount -o discard,defaults /dev/disk/by-id/scsi-0BUYVM_SLAB_VOLUME-2587 /data/
[root@localhost ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1       9.3G  1.1G  7.7G  13% /
devtmpfs        234M     0  234M   0% /dev
tmpfs           244M     0  244M   0% /dev/shm
tmpfs           244M  8.5M  236M   4% /run
tmpfs           244M     0  244M   0% /sys/fs/cgroup
tmpfs            49M     0   49M   0% /run/user/0
/dev/sda        252G  2.4G  237G   1% /data

6、开机自动挂载

[root@localhost ~]# vim /etc/fstab 

#
# /etc/fstab
# Created by anaconda on Thu Aug 29 20:11:41 2019
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=45c66935-328d-43dc-9f04-7557a14b85b1 /                       ext4    defaults        1 1
UUID=548cf316-282f-4d08-8952-f6b19bff9708 swap                    swap    defaults        0 0
/dev/disk/by-id/scsi-0BUYVM_SLAB_VOLUME-2587 /data ext4 defaults,nofail,discard 0 0

添加新评论