Forum
External harddrive overwritten as xbian-copy - Printable Version

+- Forum (http://forum.xbian.org)
+-- Forum: Software (/forum-6.html)
+--- Forum: Configuration (/forum-17.html)
+--- Thread: External harddrive overwritten as xbian-copy (/thread-4000.html)



External harddrive overwritten as xbian-copy - nickfx - 13th Nov, 2018 07:15 AM

I thought my external hard disk, containing all my movies, music and photos had failed, but instead it had been formatted as xbian-copy. I have no idea what I have done to do that, but would really like some advice on what might have happened. I used to have 2 external disks on the machine, and had used one as backup device, but removed it as I needed it elsewhere. Now it overwrote my other drive... Any idea what happened?


RE: External harddrive overwritten as xbian-copy - Nachteule - 16th Nov, 2018 11:00 PM

A misconfigured xbian-config copier command could be the culprit.
If the destination is the partition of your external harddisk, the partition would be reformatted and all existing data is lost
And of course, you can do that mistake in Kodi's xbian-config (category Backup) as well


RE: External harddrive overwritten as xbian-copy - nickfx - 17th Nov, 2018 07:21 AM

I might have set that in Kodi. In xbian-config > Xbian copier, the destination is set to /dev/dsX, presumably that means any attached hard drive.


RE: External harddrive overwritten as xbian-copy - Nachteule - 17th Nov, 2018 07:24 AM

(17th Nov, 2018 07:21 AM)nickfx Wrote:  I might have set that in Kodi. In xbian-config > Xbian copier, the destination is set to /dev/dsX, presumably that means any attached hard drive.

No, /dev/sdX is just acts as an placeholder, device /dev/sdX never exists


RE: External harddrive overwritten as xbian-copy - Nachteule - 17th Nov, 2018 07:39 AM

You can grep the file /etc/default/xbian-snap, maybe there is a /dev/sdX device configured

Terminal

grep -v "^#" /etc/default/xbian-snap | grep /dev/sd



RE: External harddrive overwritten as xbian-copy - nickfx - 18th Nov, 2018 11:37 PM

Quote:You can grep the file /etc/default/xbian-snap, maybe there is a /dev/sdX device configured

Yup, there it is...
Code:
# path to img including file name (/media/my_disk/xbian_backup.img) or block device (/dev/sda1)
IMGDEST="/dev/sda1"

# how many images should be kept (0 means unlimited)
IMGKEEP=0

# auto backup of /home should be run: none/daily/weekly/monthly
HOMEPLAN=monthly

# path to img.gz including file name (/media/my_disk/xbian_home_backup.img.gz)
HOMEDEST="notset"

# how many /home images should be kept (0 means unlimited)
HOMEKEEP=0

I wonder whether it would be safer in general to define the backup location by UUID rather than device. Otherwise this can occur whenever someone changes their hard disk configuration... I did not remember at all that I had set up a backup way back when.

nick


RE: External harddrive overwritten as xbian-copy - Nachteule - 18th Nov, 2018 11:52 PM

(18th Nov, 2018 11:37 PM)nickfx Wrote:  
Quote:You can grep the file /etc/default/xbian-snap, maybe there is a /dev/sdX device configured

Yup, there it is...
Code:
# path to img including file name (/media/my_disk/xbian_backup.img) or block device (/dev/sda1)
IMGDEST="/dev/sda1"

# how many images should be kept (0 means unlimited)
IMGKEEP=0

# auto backup of /home should be run: none/daily/weekly/monthly
HOMEPLAN=monthly

# path to img.gz including file name (/media/my_disk/xbian_home_backup.img.gz)
HOMEDEST="notset"

# how many /home images should be kept (0 means unlimited)
HOMEKEEP=0

I wonder whether it would be safer in general to define the backup location by UUID rather than device. Otherwise this can occur whenever someone changes their hard disk configuration... I did not remember at all that I had set up a backup way back when.

nick

Yes, would make more sense. But you are free to configure that variable to any value you want. I'll check later if a UUID is supported at this place

What about IMGPLAN variable. Is it set to monthly as well. If it is so, we have the explanation for your disk has been overwritten.


RE: External harddrive overwritten as xbian-copy - nickfx - 18th Nov, 2018 11:55 PM

Yes, IMGPLAN=monthly, now set to none...

Do I also need to change HOMEPLAN?


RE: External harddrive overwritten as xbian-copy - Nachteule - 18th Nov, 2018 11:59 PM

(18th Nov, 2018 11:55 PM)nickfx Wrote:  Yes, IMGPLAN=monthly, now set to none...

Do I also need to change HOMEPLAN?

Your HOMEDEST variable is set to "notset", which absolutely makes no sense. So, if you do not want to make sceduled automatic backups, set to none for HOMEPLAN would be good idea Smile


RE: External harddrive overwritten as xbian-copy - nickfx - 19th Nov, 2018 12:08 AM

Great, thanks a lot. HOMEDEST="notset" was not my doing, must have been the default. All safe now... I'll wait to hear if UUID can be used, then I might re-enable it with the 2nd hard drive. Cheers.


RE: External harddrive overwritten as xbian-copy - Nachteule - 19th Nov, 2018 12:25 AM

(19th Nov, 2018 12:08 AM)nickfx Wrote:  Great, thanks a lot. HOMEDEST="notset" was not my doing, must have been the default. All safe now... I'll wait to hear if UUID can be used, then I might re-enable it with the 2nd hard drive. Cheers.

I suppose this is not the backup strategy you want to have.

If you write to an partition, the root partition will be copied only, but not the /boot partition.

If you want to make monthly backups, you'll have to configure an image backup, with destination on your external disk (usually the disks are mouted to /media/<lLabelOfTheDisk>, so this folder does never change)

So, those variable should look like

Code:
# auto clone / image creation should be run: none/daily/weekly/monthly
IMGPLAN=monthly

# backup to img file (file) (in case of total SD card corruption, your system can be restored by reflashing this image)
# or directly to block device (block)
IMGTYPE=file

# path to img including file name (/media/my_disk/xbian_backup.img) or block device (/dev/sda1)
IMGDEST=/media/<yourbackupdisk>/xbian_image_$(date +%F).img

# how many images should be kept (0 means unlimited)
IMGKEEP=3