Hi all,
I have the following scenario in my home lab:
Connected to my Proxmox server I have a USB drive (2bay ICY-Box as ZFS Mirror) used as a target for my Urbackup server (weekly backups of various computers around the house). I want to eject said drive to power it off via WiFi-Socket (power savings, noise etc.) when the backups are done and remount it when the next backup is scheduled. Therefore I wrote two scripts (eject, remount) which I will execute via cron:
Eject-Script:
#! /bin/bash
# Shutting down Urbackup
pct shutdown 108
sleep 5
pvesm set ZFS_Backup_Pool --disable 1
umount -R /ZFS_Backup_Pool/
hdparm -Y /dev/sdb
hdparm -Y /dev/sdc
Is that a good way to "eject" the USB-drive before I cut the power?
Remount-Script:
pvesm set ZFS_Backup_Pool --disable 0
mount /dev/sdb /mnt/backup_storage
pct start 108
Where I struggle is the remount script because as soon as the USB-drive is powered on again it is not sdb and sdc anymore, but sdd and sde. Also I don't know how to go about the remount since I have two drives and a simple "mount /dev/sdb /mnt/backup_storage" doesn't cut it.
Do you have suggestions for my two scripts?
Thank's in advance!
I have the following scenario in my home lab:
Connected to my Proxmox server I have a USB drive (2bay ICY-Box as ZFS Mirror) used as a target for my Urbackup server (weekly backups of various computers around the house). I want to eject said drive to power it off via WiFi-Socket (power savings, noise etc.) when the backups are done and remount it when the next backup is scheduled. Therefore I wrote two scripts (eject, remount) which I will execute via cron:
Eject-Script:
#! /bin/bash
# Shutting down Urbackup
pct shutdown 108
sleep 5
pvesm set ZFS_Backup_Pool --disable 1
umount -R /ZFS_Backup_Pool/
hdparm -Y /dev/sdb
hdparm -Y /dev/sdc
Is that a good way to "eject" the USB-drive before I cut the power?
Remount-Script:
pvesm set ZFS_Backup_Pool --disable 0
mount /dev/sdb /mnt/backup_storage
pct start 108
Where I struggle is the remount script because as soon as the USB-drive is powered on again it is not sdb and sdc anymore, but sdd and sde. Also I don't know how to go about the remount since I have two drives and a simple "mount /dev/sdb /mnt/backup_storage" doesn't cut it.
Do you have suggestions for my two scripts?
Thank's in advance!