How to permanently mount disk on Linux VPS
If you want additional disk capacity on a VPS, usually the provider already provides it, you just need to order. After the additional disk is paid for, then mounting the additional disk to an existing server. In this tutorial I will show you how to permanently mount a disk on a Linux VPS.
The meaning here is permanent, when the server is rebooted, the disk (file system) is still detected (read) by the Linux system.
With root level, follow these steps:
1. Check file system
df -hOutput
Filesystem 1K-blocks Used Available Use% Mounted on
udev 8153480 0 8153480 0% /dev
tmpfs 1637100 9504 1627596 1% /run
/dev/sda1 229698892 65885836 152075304 31% /
tmpfs 8185484 0 8185484 0% /dev/shm
tmpfs 5120 0 5120 0% /run/lock
tmpfs 8185484 0 8185484 0% /sys/fs/cgroupIn the description of the results of the disk file system check, only /dev/sda1 is detected ( just an example, because the name can be different, for example: /dev/sda2 ), even though there are other block devices, if you check with the command list block device: it lsblkwill be visible.
2. Check list block devices
lsblkResult
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 223.6G 0 disk
|-sda0 8:1 0 1M 0 part
`-sda1 8:2 0 223.6G 0 part /
sdb 8:16 0 931.5G 0 disk
`-sdb1 8:17 0 931.5G 0 part
sr0 11:0 1 1024M 0 romDescription of the results of check block devices, there is a partition on /dev/sdb1.
We can also confirm by checking block devices ID
blkidResult
/dev/sda1: UUID="6adff89c-3178-4090-a98f-d16bc4704590" TYPE="ext4" PARTUUID="d9b163d1-0885-401d-a818-820c4drc2ea4"
/dev/sdb1: UUID="5a7db959-0c6d-4abe-9fa9-d6fad78d4880" TYPE="ext4" PARTUUID="8016131f-8c9d-4238-8a16-1266ad5era67"Description of block devices and UUID will appear. We will use the value of this UUID to create a new row in the file system table or fstablater.
3. Mounting
I gave an example from the description of the additional disk output above, for example, the name of the block devices /dev/sdb1and I will mount it to a directory /backup(free directory name).
Now we will mount /dev/sdb1/to /backup. Follow these steps:
mount command /dev/sdb1/to/backup
mount /dev/sdb1 /backup4. Mount permanen
After successfully mounting, so that it is permanent and can be read when the machine is restarted, register it to /etc/fstab
nano /etc/fstabAdd a new line according to the UUID of the partition.
UUID=5a7db959-0c6d-4abe-9fa9-d6fad78d4880 /backup ext4 defaults 05. Check the file system again
df -hMake sure there is a list/dev/sdb1 /backup
Done, hopefully useful.
If you have problems, please contact and order additional VPS disk mounting services.
Tags : ePanel linux
Redaksi
Seo Construction
I like to make cool and creative designs. My design stash is always full of refreshing ideas. Feel free to take a look around my Vcard.
- Redaksi
- Februari 24, 1989
- 1220 Manado Trans Sulawesi
- contact@example.com
- +123 456 789 111
Posting Komentar