How to Mount Vultr Block Storage Volume on FreeBSD
-
by Blog Admin
- 12
How to Mount Vultr Block Storage Volume on FreeBSD
A Unix-like operating system known for its stability, security, and advanced networking capabilities, derived from BSD Unix.
Mounting Vultr Block Storage volume on FreeBSD provides flexible and scalable file storage for Vultr Cloud Compute instances. FreeBSD supports NVMe and HDD-based Vultr Block Storage volumes.
Follow this guide to mount Vultr Block Storage volume on FreeBSD.
The following commands may destroy data on existing volumes. Use a new Vultr Block Storage volume to avoid data loss due to file system changes and partitioning.
- Attach Vultr Block Storage volume to FreeBSD.
- List all VirtIO Block Devices (
vtbd) attached to FreeBSD.console$ ls -al /dev/vtbd*Output:
crw-r----- 1 root operator 0x58 Oct 29 14:17 /dev/vtbd0 crw-r----- 1 root operator 0x59 Oct 29 14:17 /dev/vtbd0p1 crw-r----- 1 root operator 0x5a Oct 29 14:17 /dev/vtbd0p2 crw-r----- 1 root operator 0x65 Oct 29 14:30 /dev/vtbd1The Vultr Block Storage volume attaches as
/vtbd1based on the above output. The first Vultr Block Storage volume attaches to FreeBSD as/dev/vtdb1and additional volume disk names increment in a numeric order, such as/dev/vtdb2and/dev/vtdb3. - View all active partitions and verify the root filesystem disk name.
console
$ gpart showOutput:
=> 40 52428720 vtbd0 GPT (25G) 40 1024 1 freebsd-boot (512K) 1064 52427696 2 freebsd-ufs (25G)vtbd0is the root filesystem disk with two active storage partitions based on the above output. - Create a new GPT partition table for the
vtbd1Vultr Block Storage volume.console$ sudo gpart create -s GPT vtbd1Output:
vtbd1 created - Create a new partition with the
UFS2partition and a label such asvultr_block_storage.console$ sudo gpart add -t freebsd-ufs -l vultr\\_block\\_storage vtbd1
Output:
vtbd1p1 added - Initialize the
UFS2filesystem on the new Vultr Block Storage volume partition.console$ sudo newfs -U vtbd1p1Output:
/dev/vtbd1p1: 40960.0MB (83886000 sectors) block size 32768, fragment size 4096 using 66 cylinder groups of 625.22MB, 20007 blks, 80128 inodes. with soft updates super-block backups (for fsck_ffs -b #) at: 192, 1280640, 2561088, 3841536, 5121984, 6402432, 7682880, 8963328, 10243776, 11524224, 12804672, 14085120, 15365568, 16646016, 17926464, 19206912, 20487360, 21767808, 23048256, 24328704, 25609152, 26889600, 28170048, 29450496, 30730944, 32011392, 33291840, 34572288, 35852736, 37133184, 38413632, 39694080, 40974528, 42254976, 43535424, 44815872, 46096320, 47376768, 48657216, 49937664, 51218112, 524985 - Create a new mount point directory for the Vultr Block Storage volume partition.
console
$ sudo mkdir /mnt/blockstorage - Mount the Vultr Block Storage volume partition.
console
$ sudo mount -t ufs /dev/vtbd1p1 /mnt/blockstorage - View all active partitions to verify the new partition is available.
console
$ sudo gpart showOutput:
=> 40 52428720 vtbd0 GPT (25G) 40 1024 1 freebsd-boot (512K) 1064 52427696 2 freebsd-ufs (25G) => 40 83886000 vtbd1 GPT (40G) 40 83886000 1 freebsd-ufs (40G)The
vtbd1Vultr Block Storage volume partition is active on FreeBSD based on the above output. - List the Vultr Block Storage volume partition information and note the
rawuuidvalue in the command output.console$ gpart list /dev/vtbd1Output:
Geom name: vtbd1 modified: false state: OK fwheads: 16 fwsectors: 63 last: 83886039 first: 40 entries: 128 scheme: GPT Providers: 1. Name: vtbd1p1 Mediasize: 42949632000 (40G) Sectorsize: 512 Stripesize: 0 Stripeoffset: 20480 Mode: r1w1e1 efimedia: HD(1,GPT,e805ef8b-9618-11ef-bc70-315e9870b088,0x28,0x4ffffb0) rawuuid: e805ef8b-9618-11ef-bc70-315e9870b088 rawtype: 516e7cb6-6ecf-11d6-8ff8-00022d09712b label: vultr\_block\_storage length: 42949632000 offset: 20480 type: freebsd-ufs index: 1 end: 83886039 start: 40 ..........e805ef8b-9618-11ef-bc70-315e9870b088is the Vultr Block Storage volume partition UUID based on the above output. You can use the UUID value to mount the Vultr Block Storage volume partition when FreeBSD restarts. - Add a new entry to
/etc/fstabto automatically mount the Vultr Block Storage volume partition at boot. ReplaceUUID-VALUEwith the actual Vultr Block Storage volume UUID.console$ sudo echo >> sudo /etc/fstab $ sudo echo "/dev/gptid/UUID-VALUE /mnt/blockstorage ufs rw 0 0" >> sudo /etc/fstab
- View the Vultr Block Storage volume usage.
console
$ df -h /mnt/blockstorageOutput:
Filesystem Size Used Avail Capacity Mounted on /dev/vtbd1p1 39G 8.0K 36G 0% /mnt/blockstorage
How to Mount Vultr Block Storage Volume on FreeBSD A Unix-like operating system known for its stability, security, and advanced networking capabilities, derived from BSD Unix. Mounting Vultr Block Storage volume on FreeBSD provides flexible and scalable file storage for Vultr Cloud Compute instances. FreeBSD supports NVMe and HDD-based Vultr…
How to Mount Vultr Block Storage Volume on FreeBSD A Unix-like operating system known for its stability, security, and advanced networking capabilities, derived from BSD Unix. Mounting Vultr Block Storage volume on FreeBSD provides flexible and scalable file storage for Vultr Cloud Compute instances. FreeBSD supports NVMe and HDD-based Vultr…