Trying to Add USB for Backup Storage

Danielc1234

Active Member
Jan 10, 2010
82
0
26
Hi all, I just plugged in our 1TB USB drive in order to try and use as a backup drive.
After I plugged in the drive, it looks like Proxmox did recognize it, but it is not showing up.
When I went into the Add ISCSI Target under Storage. I'm not quite sure which Portal to use to enable to try and scan the drive so it can be utilized.
Can someone please let me know what I am doing wrong?
I posted the log file showing that proxmox was able to see the drive. I only want this as a means for backup the VMs etc. We are trying to use this method until we can come up with something better.

Thanks
Daniel

Code:
Nov 6 10:59:34     kernel         usb 3-6: new high speed USB device using ehci_hcd and address 2
Nov 6 10:59:35     kernel         usb 3-6: New USB device found, idVendor=04e8, idProduct=5f07
Nov 6 10:59:35     kernel         usb 3-6: New USB device strings: Mfr=1, Product=11, SerialNumber=3
Nov 6 10:59:35     kernel         usb 3-6: Product: Samsung STORY Station
Nov 6 10:59:35     kernel         usb 3-6: Manufacturer: JMicron
Nov 6 10:59:35     kernel         usb 3-6: SerialNumber: 00000011E09310500112
Nov 6 10:59:35     kernel         usb 3-6: configuration #1 chosen from 1 choice
Nov 6 10:59:35     kernel         Initializing USB Mass Storage driver...
Nov 6 10:59:35     kernel         scsi5 : SCSI emulation for USB Mass Storage devices
Nov 6 10:59:35     kernel         usb-storage: device found at 2
Nov 6 10:59:35     kernel         usb-storage: waiting for device to settle before scanning
Nov 6 10:59:35     kernel         usbcore: registered new interface driver usb-storage
Nov 6 10:59:35     kernel         USB Mass Storage support registered.
Nov 6 10:59:40     kernel         usb-storage: device scan complete
Nov 6 10:59:40     kernel         scsi 5:0:0:0: Direct-Access Samsung STORY Station PQ: 0 ANSI: 2 CCS
Nov 6 10:59:40     kernel         sd 5:0:0:0: Attached scsi generic sg6 type 0
Nov 6 10:59:40     kernel         sd 5:0:0:0: [sdb] 3907029168 512-byte logical blocks: (2.00 TB/1.81 TiB)
Nov 6 10:59:40     kernel         sd 5:0:0:0: [sdb] Write Protect is off
Nov 6 10:59:40     kernel         sd 5:0:0:0: [sdb] Mode Sense: 28 00 00 00
Nov 6 10:59:40     kernel         sd 5:0:0:0: [sdb] Assuming drive cache: write through
Nov 6 10:59:40     kernel         sd 5:0:0:0: [sdb] Assuming drive cache: write through
Nov 6 10:59:40     kernel         sdb: sdb1
Nov 6 10:59:40     kernel         sd 5:0:0:0: [sdb] Assuming drive cache: write through
Nov 6 10:59:40     kernel         sd 5:0:0:0: [sdb] Attached SCSI disk
Nov 6 11:00:01     pvedaemon    2985     WARNING: Cannot encode 'meminfo' element as 'hash'. Will be encoded as 'map' instead
Nov 6 11:00:01     cron    23463     (root) CMD (/usr/share/vzctl/scripts/vpsreboot)
Nov 6 11:00:01     cron    23464     (root) CMD (/usr/share/vzctl/scripts/vpsnetclean)
Nov 6 11:00:01     cron    23465     (root) CMD (test -x /usr/lib/atsar/atsa1 && /usr/lib/atsar/atsa1)
Nov 6 11:00:11     pvedaemon    2987     WARNING: Cannot encode 'meminfo' element as 'hash'. Will be encoded as 'map' instead
Nov 6 11:00:16     pvedaemon    2985     WARNING: Cannot encode 'meminfo' element as 'hash'. Will be encoded as 'map' instead
Nov 6 11:00:18     kernel         RPC: Registered udp transport module.
Nov 6 11:00:18     kernel         RPC: Registered tcp transport module.
Nov 6 11:00:18     kernel         RPC: Registered tcp NFSv4.1 backchannel transport module.
Nov 6 11:00:18     kernel         Slow work thread pool: Starting up
Nov 6 11:00:18     kernel         Slow work thread pool: Ready
Nov 6 11:00:18     kernel         FS-Cache: Loaded
Nov 6 11:00:18     kernel         FS-Cache: Netfs 'nfs' registered for caching
Nov 6 11:00:18     kernel         svc: failed to register lockdv1 RPC service (errno 97).
Nov 6 11:00:31     proxwww    23522     Starting new child 23522
 
Hi,
your disk isn't a iSCSi-Target, so why should the disk pop up in this menu??

You can simple mount the disk to an directory, like this:
Code:
mkdir /backup
mount /dev/sdb1 /backup
You can also create an entry in /etc/fstab but then be sure to have the drive connected the whole time (or use no auto mount in fstab).
If you go for an fstab-entry use the UUID, because the disk-order (sdb, sdc, ...) can changed.
Use "blkid" to see the right ID (in your case for sdb1).
Don't forget umount, before disconnect the usb-drive.

After that you can use the directory for backup (configured in the storage-gui). I suggest to use an directory on the usb-disk ( like /backup/pve-backup ) - so the backup fails if your disk isn't mounted instead of filling your root-partition (because of writing to /backup) and fails than (and you run in more trouble).

Udo
 
@Udo,

I took your advice and set it up with the mount /dev/sdb1 /backup and is not showing up as a backup source in the backup GUI.
If I restart the server or whatever, does that mean I will have to do this all over again? Or will this cause any issues on a restart?

Thanks
 
Great!
It is very useful information so I took your advice and set it up with the mount /dev/sdb1 /backup and is not showing up as a backup source in the backup GUI.
Thanks.
 
Once I did this... it showed.


Code:
mkdir /backup
mount /dev/sdb1 /backup

I got a successful backup, however in the log file I see some errors.
What does this mean?

Code:
105: Nov 06 14:36:13 INFO: Starting Backup of VM 105 (openvz)
105: Nov 06 14:36:13 INFO: CTID 105 exist mounted running
105: Nov 06 14:36:13 INFO: status = CTID 105 exist mounted running
105: Nov 06 14:36:13 INFO: backup mode: snapshot
105: Nov 06 14:36:13 INFO: ionice priority: 7
105: Nov 06 14:36:13 INFO: trying to remove stale snapshot '/dev/pve/vzsnap-ourserver-0'
105: Nov 06 14:36:13 INFO: umount: /mnt/vzsnap0: not mounted
105: Nov 06 14:36:13 ERROR: command 'umount /mnt/vzsnap0' failed with exit code 1
105: Nov 06 14:36:13 INFO:   /dev/dm-5: read failed after 0 of 4096 at 0: Input/output error
105: Nov 06 14:36:14 INFO:   Logical volume "vzsnap-ourserver-0" successfully removed
105: Nov 06 14:36:14 INFO: creating lvm snapshot of /dev/mapper/pve-data ('/dev/pve/vzsnap-ourserver-0')
105: Nov 06 14:36:14 INFO:   Logical volume "vzsnap-ourserver-0" created
105: Nov 06 14:36:14 INFO: creating archive '/backup/vzdump-openvz-105-2011_11_06-14_36_02.tar'
105: Nov 06 14:37:21 INFO: Total bytes written: 1430722560 (1.4GiB, 22MiB/s)
105: Nov 06 14:37:21 INFO: archive file size: 1.33GB
105: Nov 06 14:37:24 INFO:   Logical volume "vzsnap-ourserver-0" successfully removed
105: Nov 06 14:37:24 INFO: Finished Backup of VM 105 (00:01:22)
 
I got a successful backup, however in the log file I see some errors.
What does this mean?

There was a stale snapshot device from a previous backup - maybe you aborted a previous vzdump job somehow? Vzdump tries to cleanup that device. I guess you can safely ignore those errors.
 
Dietmar,

How do I remove manually stale snapshot and/or previous vzdumps?
I tried another backup last night and this morning all my backups of the VMs failed.

Code:
105: Nov 07 01:30:13 INFO: Starting Backup of VM 105 (openvz)
105: Nov 07 01:30:13 INFO: CTID 105 exist mounted running
105: Nov 07 01:30:13 INFO: status = CTID 105 exist mounted running
105: Nov 07 01:30:13 INFO: backup mode: snapshot
105: Nov 07 01:30:13 INFO: ionice priority: 7
105: Nov 07 01:30:13 INFO: trying to remove stale snapshot '/dev/pve/vzsnap-ourserver-0'
105: Nov 07 01:30:13 INFO: umount: /mnt/vzsnap0: device is busy
105: Nov 07 01:30:13 INFO: umount: /mnt/vzsnap0: device is busy
105: Nov 07 01:30:13 ERROR: command 'umount /mnt/vzsnap0' failed with exit code 1
105: Nov 07 01:30:13 INFO:   /dev/dm-2: read failed after 0 of 4096 at 0: Input/output error
105: Nov 07 01:30:13 INFO:   Can't remove open logical volume "vzsnap-ourserver-0"
105: Nov 07 01:30:13 ERROR: command 'lvremove -f /dev/pve/vzsnap-ourserver-0' failed with exit code 5
105: Nov 07 01:30:13 INFO: creating lvm snapshot of /dev/mapper/pve-data ('/dev/pve/vzsnap-ourserver-0')
105: Nov 07 01:30:13 INFO:   /dev/dm-2: read failed after 0 of 4096 at 0: Input/output error
105: Nov 07 01:30:13 INFO:   Logical volume "vzsnap-ourserver-0" already exists in volume group "pve"
105: Nov 07 01:30:13 INFO:   /dev/dm-2: read failed after 0 of 4096 at 0: Input/output error
105: Nov 07 01:30:13 INFO:   Can't remove open logical volume "vzsnap-ourserver-0"
105: Nov 07 01:30:13 ERROR: command 'lvremove -f /dev/pve/vzsnap-ourserver-0' failed with exit code 5
105: Nov 07 01:30:13 ERROR: Backup of VM 105 failed - command 'lvcreate --size 1024M --snapshot --name vzsnap-ourserver-0 /dev/pve/data' failed with exit code 5


101: Nov 07 01:30:13 INFO: Starting Backup of VM 101 (qemu)
101: Nov 07 01:30:13 INFO: running
101: Nov 07 01:30:13 INFO: status = running
101: Nov 07 01:30:13 INFO: backup mode: snapshot
101: Nov 07 01:30:13 INFO: ionice priority: 7
101: Nov 07 01:30:13 INFO: trying to remove stale snapshot '/dev/pve/vzsnap-ourserver-0'
101: Nov 07 01:30:13 INFO: umount: /mnt/vzsnap0: device is busy
101: Nov 07 01:30:13 INFO: umount: /mnt/vzsnap0: device is busy
101: Nov 07 01:30:13 ERROR: command 'umount /mnt/vzsnap0' failed with exit code 1
101: Nov 07 01:30:13 INFO:   /dev/dm-2: read failed after 0 of 4096 at 0: Input/output error
101: Nov 07 01:30:13 INFO:   Can't remove open logical volume "vzsnap-ourserver-0"
101: Nov 07 01:30:13 ERROR: command 'lvremove -f '/dev/pve/vzsnap-ourserver-0'' failed with exit code 5
101: Nov 07 01:30:13 INFO:   /dev/dm-2: read failed after 0 of 4096 at 0: Input/output error
101: Nov 07 01:30:13 INFO:   Logical volume "vzsnap-ourserver-0" already exists in volume group "pve"
101: Nov 07 01:30:14 INFO:   /dev/dm-2: read failed after 0 of 4096 at 0: Input/output error
101: Nov 07 01:30:14 INFO:   Can't remove open logical volume "vzsnap-ourserver-0"
101: Nov 07 01:30:14 ERROR: command 'lvremove -f '/dev/pve/vzsnap-ourserver-0'' failed with exit code 5
101: Nov 07 01:30:14 ERROR: Backup of VM 101 failed - command 'lvcreate --size 1024M --snapshot --name 'vzsnap-ourserver-0' '/dev/pve/data'' failed with exit code 5


102: Nov 07 01:30:14 INFO: Starting Backup of VM 102 (qemu)
102: Nov 07 01:30:14 INFO: running
102: Nov 07 01:30:14 INFO: status = running
102: Nov 07 01:30:14 INFO: backup mode: snapshot
102: Nov 07 01:30:14 INFO: ionice priority: 7
102: Nov 07 01:30:14 INFO: trying to remove stale snapshot '/dev/pve/vzsnap-ourserver-0'
102: Nov 07 01:30:14 INFO: umount: /mnt/vzsnap0: device is busy
102: Nov 07 01:30:14 INFO: umount: /mnt/vzsnap0: device is busy
102: Nov 07 01:30:14 ERROR: command 'umount /mnt/vzsnap0' failed with exit code 1
102: Nov 07 01:30:14 INFO:   /dev/dm-2: read failed after 0 of 4096 at 0: Input/output error
102: Nov 07 01:30:14 INFO:   Can't remove open logical volume "vzsnap-ourserver-0"
102: Nov 07 01:30:14 ERROR: command 'lvremove -f '/dev/pve/vzsnap-ourserver-0'' failed with exit code 5
102: Nov 07 01:30:14 INFO:   /dev/dm-2: read failed after 0 of 4096 at 0: Input/output error
102: Nov 07 01:30:14 INFO:   Logical volume "vzsnap-ourserver-0" already exists in volume group "pve"
102: Nov 07 01:30:14 INFO:   /dev/dm-2: read failed after 0 of 4096 at 0: Input/output error
102: Nov 07 01:30:14 INFO:   Can't remove open logical volume "vzsnap-ourserver-0"
102: Nov 07 01:30:14 ERROR: command 'lvremove -f '/dev/pve/vzsnap-ourserver-0'' failed with exit code 5
102: Nov 07 01:30:14 ERROR: Backup of VM 102 failed - command 'lvcreate --size 1024M --snapshot --name 'vzsnap-ourserver-0' '/dev/pve/data'' failed with exit code 5


103: Nov 07 01:30:14 INFO: Starting Backup of VM 103 (qemu)
103: Nov 07 01:30:14 INFO: running
103: Nov 07 01:30:14 INFO: status = running
103: Nov 07 01:30:15 INFO: backup mode: snapshot
103: Nov 07 01:30:15 INFO: ionice priority: 7
103: Nov 07 01:30:15 INFO: trying to remove stale snapshot '/dev/pve/vzsnap-ourserver-0'
103: Nov 07 01:30:15 INFO: umount: /mnt/vzsnap0: device is busy
103: Nov 07 01:30:15 INFO: umount: /mnt/vzsnap0: device is busy
103: Nov 07 01:30:15 ERROR: command 'umount /mnt/vzsnap0' failed with exit code 1
103: Nov 07 01:30:15 INFO:   /dev/dm-2: read failed after 0 of 4096 at 0: Input/output error
103: Nov 07 01:30:15 INFO:   Can't remove open logical volume "vzsnap-ourserver-0"
103: Nov 07 01:30:15 ERROR: command 'lvremove -f '/dev/pve/vzsnap-ourserver-0'' failed with exit code 5
103: Nov 07 01:30:15 INFO:   /dev/dm-2: read failed after 0 of 4096 at 0: Input/output error
103: Nov 07 01:30:15 INFO:   Logical volume "vzsnap-ourserver-0" already exists in volume group "pve"
103: Nov 07 01:30:15 INFO:   /dev/dm-2: read failed after 0 of 4096 at 0: Input/output error
103: Nov 07 01:30:15 INFO:   Can't remove open logical volume "vzsnap-ourserver-0"
103: Nov 07 01:30:15 ERROR: command 'lvremove -f '/dev/pve/vzsnap-ourserver-0'' failed with exit code 5
103: Nov 07 01:30:15 ERROR: Backup of VM 103 failed - command 'lvcreate --size 1024M --snapshot --name 'vzsnap-ourserver-0' '/dev/pve/data'' failed with exit code 5


104: Nov 07 01:30:15 INFO: Starting Backup of VM 104 (qemu)
104: Nov 07 01:30:15 INFO: running
104: Nov 07 01:30:15 INFO: status = running
104: Nov 07 01:30:15 INFO: backup mode: snapshot
104: Nov 07 01:30:15 INFO: ionice priority: 7
104: Nov 07 01:30:15 INFO: trying to remove stale snapshot '/dev/pve/vzsnap-ourserver-0'
104: Nov 07 01:30:15 INFO: umount: /mnt/vzsnap0: device is busy
104: Nov 07 01:30:15 INFO: umount: /mnt/vzsnap0: device is busy
104: Nov 07 01:30:15 ERROR: command 'umount /mnt/vzsnap0' failed with exit code 1
104: Nov 07 01:30:15 INFO:   /dev/dm-2: read failed after 0 of 4096 at 0: Input/output error
104: Nov 07 01:30:15 INFO:   Can't remove open logical volume "vzsnap-ourserver-0"
104: Nov 07 01:30:15 ERROR: command 'lvremove -f '/dev/pve/vzsnap-ourserver-0'' failed with exit code 5
104: Nov 07 01:30:15 INFO:   /dev/dm-2: read failed after 0 of 4096 at 0: Input/output error
104: Nov 07 01:30:15 INFO:   Logical volume "vzsnap-ourserver-0" already exists in volume group "pve"
104: Nov 07 01:30:16 INFO:   /dev/dm-2: read failed after 0 of 4096 at 0: Input/output error
104: Nov 07 01:30:16 INFO:   Can't remove open logical volume "vzsnap-ourserver-0"
104: Nov 07 01:30:16 ERROR: command 'lvremove -f '/dev/pve/vzsnap-ourserver-0'' failed with exit code 5
104: Nov 07 01:30:16 ERROR: Backup of VM 104 failed - command 'lvcreate --size 1024M --snapshot --name 'vzsnap-ourserver-0' '/dev/pve/data'' failed with exit code 5
 
@Udo,

I took your advice and set it up with the mount /dev/sdb1 /backup and is not showing up as a backup source in the backup GUI.
If I restart the server or whatever, does that mean I will have to do this all over again? Or will this cause any issues on a restart?

Thanks
Hi Daniel,
it's looks that my english is not good enough...

After mounting (and creating an fstab-entry?).
Gui -> Storage -> Storage List -> Add directory
Storage name : local_backup
driectory: /backup/pve-backup (must be on the usb-disk)
content: VZDump Backup
Shared: not marked!

After that you should be able to select this backup-storage.

Udo
 
  • Like
Reactions: jco1904
I have not tried this as a backup device , but this may work, check usbmount . once installed it will mount the usbdevice to a consistent location, without the need to edit fstab:

aptitude install usbmount
 
I'm getting errors... please see log file above. I need to get rid of the stale backup that went wrong.
 
Last edited:
How familiar are you with lvm? I'm far from an expert, but have run into stuck files in /dev/mapper [ when using encrypted usb drives ] and have to remove with:

Code:
dmsetup remove /dev/mapper/udisks-luks-uuid-47ce7965-37f8-4a16-9a1d-b276a7fa30d5-uid1700
dmsetup remove /dev/mapper/udisks-luks-uuid-811ffdb5-c662-4f87-9dfd-add2f7831920-uid1700

so try
Code:
ls -l /dev/mapper

and maybe there is something to remove?