[Solved] How to mount storage volume on VPS ?

Fordebk

New Member
Joined
Mar 12, 2021
Messages
21
Reaction score
12
Credits
178
Hello,

I’m beginner on Debian and never used it before.

I’ve bought a VPS with Debian, with 100 Go for storage. Every action that I do is with SSL.

I want use this VPS with a graphic desktop. By default, I’ve got two volumes :
  • /dev/vda which contains my OS (20 Go)
  • /dev/vdb which contains free space (80 Go) and is not mounted
I’ve installed Debian desktop and then X2GO (VNC doesn’t work, it is another problem).

But when I’ve done that, I can only use the 20 Go space and if I try to access to the free storage, I’ve got a security message and cannot access from my debian desktop.

So I’ve tried to mount /dev/vdb. My provider advice is to enter these command lines :

sudo apt install xfsprogs
sudo mkfs.xfs -f /dev/vdb
mkdir /mnt/home
mount /dev/vdb /mnt/home
rsync -rlptgoDHAX /home/ /mnt/home/
umount /mnt/home
mount /dev/vdb /home
rmdir /mnt/home

When I put the third command, I’ve got this error message :

mkdir: cannot create directory ‘/mnt/home’: File exists

If I try directly this command :

sudo mount /dev/vdb /home

Then I cannot connect to my server again and I have to restart it.

How can I mount this /dev/vdb part and use that free storage ?
 


Can you share the output of the following commands.
Code:
cat /etc/fstab
lsblk
ls -l /mnt/home
 
Thanks for your help. With the first line I've got that :

# /etc/fstab: static file system information.
UUID=65b4bbd6-39d1-49da-b0af-65261fa0b4a8 / ext4 errors=remount-ro 0 1

The second gives me this result :

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sr0 11:0 1 558K 0 rom
vda 254:0 0 20G 0 disk
└─vda1 254:1 0 20G 0 part /
vdb 254:16 0 100G 0 disk

And the last produces this line :

ls: cannot access '/mnt/home': No such file or directory
 
You will have to do the following.
I. Run fdisk:
1. sudo fdisk /dev/vdb
2. press n, then enter.
3. press p, then enter.
4. press enter.
5. press enter.
6. press enter.
7. press w, then enter.

II. Create filesystem on your storage disk:
1. sudo mkfs.xfs -f /dev/vdb1

II. Create mount point for your storage disk.
1. sudo mkdir /mnt/home

III. Mount your storage disk.
1. sudo mount /dev/vdb1 /mnt/home
---------------------------------------------------------------------
What your provider advised in these following steps should tecnically work but they forgot a step and those steps are assuming you want your storage disk to be your /home as well as mounted on /home. Do you actually want that? Let's just first start with these steps to see how far you get and for you to answer my question so that we can resume from there as in how you want your storage disk setup.
 
When I try this, I've got a problem with the second step (create filesystem on storage disk) :

Welcome to fdisk (util-linux 2.33.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

The old xfs signature will be removed by a write command.

Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0x6425620b.

Command (m for help): n
Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1):
First sector (2048-209715199, default 2048):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-209715199, default 209715199):

Created a new partition 1 of type 'Linux' and of size 100 GiB.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

debian@ov-88068f:~$ sudo mkfs.xfs -f /dev/vdb1
sudo: mkfs.xfs: command not found
 
Try this instead then.
Code:
sudo mkfs.ext4 /dev/vdb1
Can you also answer my questions from my last reply?
 
I believe I've made a mistake.

I guess home is right, but I don't really understand what it will do better or not than other place.

About commands, when I change with ext4, it seems it works. Now, if I put :


I've got :

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sr0 11:0 1 558K 0 rom
vda 254:0 0 20G 0 disk
└─vda1 254:1 0 20G 0 part /
vdb 254:16 0 100G 0 disk
└─vdb1 254:17 0 100G 0 part /mnt/home

But I think I've did something wrong. Before, on my Debian desktop, I've had an icon to access to my storage disk (100 Go) and this access didn't worked. Now, it seems the storage is mounted but I have none icon to access that on my desktop. It seems I cannot access to it and I only have 13.3 Gb free space.

Edit : I've found it but whithout access, I've took a snap and uploaded it here :

 
I guess home is right, but I don't really understand what it will do better or not than other place.
You are correct, so if that doesn't matter to you it is fine to keep it mounted at that place and you can store your data there, you just have the make it permanent by adding the following to /etc/fstab.
Code:
/dev/vdb1      /mnt/home       ext4        defaults 1 2

But I think I've did something wrong. Before, on my Debian desktop, I've had an icon to access to my storage disk (100 Go) and this access didn't worked. Now, it seems the storage is mounted but I have none icon to access that on my desktop. It seems I cannot access to it and I only have 13.3 Gb free space.
Edit : I've found it but whithout access, I've took a snap and uploaded it here :
You are going to have to be a bit more specific than that since, how did you sit up before the first time?
 
I have to add this at the end of the /etc/fstab ?

To sum up my question, how can I add a file on my vdb1 storage (100 Go) when I am on my debian desktop (which is on vda1) ?
And how can I access to the data on my vdb1 storage when I am on my debian desktop ?

Thanks for everything, a lot !
 
I think I missed the part that you had a graphical environment on your VPS. I guess you could try the remaining steps of what your hosting provider advised before, so try the following again.
1. rsync -rlptgoDHAX /home/ /mnt/home/
2. umount /mnt/home
3. mount /dev/vdb1 /home
4. rmdir /mnt/home
5. Edit the previous entry I had you create (which has /dev/vdb1 mounted on /mnt/home) to look like this instead.
Code:
/dev/vdb1      /home       ext4        defaults 1 2
6. Reboot your system
Does it work now?
 
Try installing it first then, so like this.
Code:
sudo apt install rsync
 
Just a heads up, that error on rsync under Debian is usually in response to not prefacing the command with sudo.

Rsync should already be installed.

Cheers

Wiz
 
Just a heads up, that error on rsync under Debian is usually in response to not prefacing the command with sudo.

Rsync should already be installed.

Cheers

Wiz
I would find that strange since on my vm running debian it works without sudo, because rsync is installed under /usr/bin and not under /usr/sbin.
 
The sudo before rsync didn't change anything. After I've installed it, the command lines worked.

But I didn't manage to edit the /etc/fstab and now when I try to connect to my graphic desktop, it asks me a password I have not.

If I try :

sudo gedit /etc/fstab

Then I've got :

Unable to init server: Could not connect: Connection refused
 
Can you share the steps you did to get to where you are now and are you able to or not able to login to your graphical environment? Since you didn't edit your /etc/fstab yet shouldn't have effect on your being able to login into your graphical environment. I just tried the same steps on a virtual machine and that worked for me without running into anything, so I'm not sure what you did?
 
Last edited:
After I've installed it, the command lines worked.

That is good news but still strange, I have 5 - 6 Debian and directly related to Debian Distros on board, and rsync is installed by default.

I'll leave you in @f33dm3bits 's capable hands, and welcome to linux.org @Fordebk :)

Wizard
 
I've try to reinitiate my server to do every step again and report them.

But after three reinitialization, I've got a problem : x2go didn't work anymore.

At the beggining, I do that :

sudo apt-get update
sudo apt-get install task-xfce-desktop
sudo apt-get install x2goserver x2goserver-xsession

I install x2go on Windows and load my private key, which previously worked with x2go.

And when I try to login, I've got an error message saying host key verification failed

Since I am stuck in this problem. Do you have any idea please ?

Thank you wizardfromoz !
 
The problem with x2go is solved (with flushdns which didn't work the first time).

So I've reinitiate again.

After these commands it works :

sudo apt-get update
sudo apt-get install task-xfce-desktop
sudo apt-get install x2goserver x2goserver-xsession

After that, I launch fdisk :

sudo fdisk /dev/vdb
press n

And when I press n, I get this :

debian:~$ sudo fdisk /dev/vdb

Welcome to fdisk (util-linux 2.33.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): n
All space for primary partitions is in use.

If I try to press p, I got that :

Disk /dev/vdb: 100 GiB, 107374182400 bytes, 209715200 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x6425620b

Device Boot Start End Sectors Size Id Type
/dev/vdb1 2048 209715199 209713152 100G 83 Linux

To be more accurate, I can see the icon of free stockage now but cannot access it (I'll add a screenshot ; edit : screenshots added).
 

Attachments

  • Capture.PNG
    Capture.PNG
    58 KB · Views: 295
  • open.PNG
    open.PNG
    48.8 KB · Views: 292
If I am understanding you correctly you recreated the partition on your storage disk? Then you first have to create a filesystem before you can mount it so that you can access it.
Code:
sudo mkfs.ext4 /dev/vdb1
Then it will appear on your desktop as device which you can click on to open. If you then still like you can then create a mount point and mount it there.
Code:
sudo mkdir /mnt/storage
sudo mount /dev/vdb1 /mnt/storage
 

Staff online


Top