using USB Hard drive to store backups

Manny Vazquez

Well-Known Member
Jul 12, 2017
107
2
58
Miami, FL USA
Hi,

I have attached a drive to one of my hosts (VM4), and formatted it ext4, and mounted to /mnt/external
upload_2018-11-8_14-31-56.png
upload_2018-11-8_14-32-46.png

I also added this to the storage
upload_2018-11-8_14-33-40.png

and enabled all the options
upload_2018-11-8_14-34-3.png
Now I can see it from all the hosts
upload_2018-11-8_14-34-40.png
And even backups seem to be working fine, in all the 3 hosts
upload_2018-11-8_14-35-26.png
upload_2018-11-8_14-35-45.png
upload_2018-11-8_14-35-59.png

My question is, if I reformat one of the hosts, (in order to do a clean version update to 5.2), how can I make sure I will be able to see these backups when I can not see the content across the hosts now?
I other words, I can see the content of /mnt/external from each one of the hosts, via console, but I can not see the files of the other hosts..
upload_2018-11-8_14-40-58.png

If I have done something wrong, I am ok with starting over, just need to make sure I can see ALL the lzo files so I can restore the VMs in the NEWLY installed hosts after installing fresh the new version.
 

Attachments

  • upload_2018-11-8_14-33-20.png
    upload_2018-11-8_14-33-20.png
    20.6 KB · Views: 24
This drive is only available on host VM4. Because it is a phy device not shared with other members of the cluster. The space what you see on the other hosts is only the local available rootspace. So you see on each host only his own backupfiles.

What can you do? You can mount this external drive on VM4, export it es NFS/Samba and add this share do your Cluster/Storage Configuration.

So the reason why you can't see the files on the new installed host is, they were on the rootfilesystem, and after you installed the node fresh with the ISO, they were deleted.

Here are us USB-Autmountpackages: https://forum.proxmox.com/threads/usb-automount.39296/
 
This drive is only available on host VM4. Because it is a phy device not shared with other members of the cluster. The space what you see on the other hosts is only the local available rootspace. So you see on each host only his own backupfiles.

What can you do? You can mount this external drive on VM4, export it es NFS/Samba and add this share do your Cluster/Storage Configuration.

So the reason why you can't see the files on the new installed host is, they were on the rootfilesystem, and after you installed the node fresh with the ISO, they were deleted.

Here are us USB-Autmountpackages: https://forum.proxmox.com/threads/usb-automount.39296/
That makes a lot of sense and it is exactly what I was afraid of. That's why I had not formatted yet.
would the proper procedure be?
1: Stop backups to this /mnt/external mount
2: Delete the backups (or scp them to the USB drive directly from terminal?)
3: remove /mnt/external from the cluster
4: unmount the usb drive on vm4
5: Reformat /dev/sdb1 to ntfs ?????
6: follow sharing instructions ..

Thanks
 
1: Stop backups to this /mnt/external mount
OK
2: Delete the backups (or scp them to the USB drive directly from terminal?)
Yes with "cp" or "rsync"
3: remove /mnt/external from the cluster
OK
4: unmount the usb drive on vm4
OK
5: Reformat /dev/sdb1 to ntfs ?????
Why NTFS? Should the backup readable @Windows? Use Ext4.
6: follow sharing instructions ..
OK.
 
OK

Yes with "cp" or "rsync"

OK

OK

Why NTFS? Should the backup readable @Windows? Use Ext4.

OK.
Thanks..
I have it in ext4, so I do not think I need to reformat, right?
Now, I have the usb mounted on VM4 at /mnt/external and it is visible from command
upload_2018-11-9_16-58-44.png
Mounted twice to make sure it was ok and right..

But now
I try
upload_2018-11-9_16-59-52.png
upload_2018-11-9_17-0-37.png
I get this.
upload_2018-11-9_17-1-3.png
and of course it get a NotOnline error..
upload_2018-11-9_17-1-43.png
What am I missing?
 
Seems like I had a typo on the nfs share config.

I can now see all my backups from all the VMs.

upload_2018-11-9_17-29-8.png

This is the greatest ever ..

One last question, once I reformat the hosts with new proxmox version, will I have any privileges error (on the usb drive)?
(I am going to use same user - root- and same password as it is now)
 
Last edited:
  • Like
Reactions: fireon
Root work from everywhere. Except you locked root explicit on the nfsexport.
 
In the nfsexportsfile. For expample:
Code:
/v-machines/home        *(acl,async,no_subtree_check,rw,root_squash)
No rootaccess.
 
In the nfsexportsfile. For expample:
Code:
/v-machines/home        *(acl,async,no_subtree_check,rw,root_squash)
No rootaccess.
changed like this

upload_2018-11-11_10-35-52.png
upload_2018-11-11_10-36-22.png
At this point I can go into any other host, and create a directory (test) into the mounted shared drive
upload_2018-11-11_10-40-10.png

But when I try to run a backup, still get errors
===================================
INFO: starting new backup job: vzdump 102 --mode snapshot --node vm3 --remove 0 --storage usbdrive --compress lzo
ERROR: Backup of VM 102 failed - unable to create temporary directory '/mnt/pve/usbdrive/dump/vzdump-qemu-102-2018_11_11-10_38_09.tmp' at /usr/share/perl5/PVE/VZDump.pm line 842.
INFO: Backup job finished with errors
TASK ERROR: job errors
================================

I tried creating a test text file into the dump directory, but it did not work.
upload_2018-11-11_10-41-22.png

do I have to start by reformatting drive?
======================================
An idea came in..

I have chmod -R 777 the whole mount on the original host (/msn/external, the one sharing) and now I can run backups across all the hosts..
This was just a small stopped vm that was giving me trouble
upload_2018-11-11_10-49-38.png

Thanks.

Do you think I could / should have done something different?
 

Attachments

  • upload_2018-11-11_10-34-1.png
    upload_2018-11-11_10-34-1.png
    9.4 KB · Views: 5
Yes thats right. I has to do with ACL's. Please read the manpage about NFS-Server. If you have "rwxr-xr-x" then it works, because read access for the world. If you would lose rootaccess, you must change owner to a normal user and say "rwx------" say 700. This make sense on hosts with ldap and useraccess too. Then root is hasent access anymore with nfsmount.
 
Yes thats right. I has to do with ACL's. Please read the manpage about NFS-Server. If you have "rwxr-xr-x" then it works, because read access for the world. If you would lose rootaccess, you must change owner to a normal user and say "rwx------" say 700. This make sense on hosts with ldap and useraccess too. Then root is hasent access anymore with nfsmount.

Thanks.. I am still learning, love this platform, hope I can convince the owner of the company to move all the enviroment to proxmox and away from vmware, so I can put the budget into paying support :)
 
Thanks.. I am still learning, love this platform, hope I can convince the owner of the company to move all the enviroment to proxmox and away from vmware, so I can put the budget into paying support
Really nice! Good succeed :):cool::cool:
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!