Forum
  • Search
  • Member List
  • Calendar
Hello There, Guest! Login Register — Login with Facebook

home backup files vanish
Thank you for your donation

Thread Closed 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode | Linear Mode
home backup files vanish
18th Apr, 2021, 03:33 AM
Post: #7
alcina Offline
Registered
Posts: 9
Joined: Sep 2015
Reputation: 1
RE: home backup files vanish
Ok...so I ran:
Code:
btrfs subvolume snapshot -r /home /root/.snaps/home-20210417
to create the snapshot of /home.
It resulted:
Code:
Create a readonly snapshot of '/home' in '/root/.snaps/home-20210417'

Then, to copy the snapshot to an image file on the NAS, I ran:
Code:
btrfs send -v /root/.snaps/home-20210417 > /mnt/ReadyNAS2/xbian/newbackups/home-20210417.img
It resulted:
Code:
At subvol /root/.snaps/home-20210417
BTRFS_IOC_SEND returned 0
joining genl thread

The file was happily sitting there on the NAS Smile

Then, to make it a bit more like /usr/local/sbin/xbian-storager I ran:
Code:
btrfs send -v /root/.snaps/home-20210417 | gzip -1 >> /mnt/ReadyNAS2/xbian/newbackups/home-20210417.img.gz
It resulted:
Code:
At subvol /root/.snaps/home-20210417
BTRFS_IOC_SEND returned 0
joining genl thread

The file was happily sitting there on the NAS Smile

So I installed a syslogger and ran "backup now" from the GUI. All happened exactly as before: the file appeared, it got bigger until it was finished, then immediately disappeared. The relevant syslog lines are:
Code:
Apr 17 16:13:55 xbiansnug btrfs-auto-snapshot: xbiancopy mount /mnt/ReadyNAS2/xbian/newbackups/xbiansnug_backup_home_2021-04-17.img.gz
Apr 17 16:41:12 xbiansnug btrfs-auto-snapshot: xbiancopy umount

To me it looks like the file is getting deleted the moment after it is created. I am presuming lines 1659-1662 in xbian-storager are relevant:

Code:
if [ "$RC" -ne 0 ]; then
        rm -f "$FILE"
        exit 1
    fi

It's looking like it's not receiving an exit code of 0 and so is deleting the file. So I nobbled those lines in xbian-storager:

Code:
if [ "$RC" -ne 0 ]; then
        #rm -f "$FILE"
        echo $RC >> /root/exitcode
        exit 1
    fi

and ran "backup now" from the GUI.

The file appeared on the NAS, it got bigger and bigger until it was nearly the same size as /home, then...it stayed! Smile The contents of /root/exitcode was, as expected, "1"

I ran it again to reproduce the problem. The resultant gzipped image files are all slightly different sizes, with the ones being created by xbian-storager being smaller. I am presuming that is to do with the fact that xbian-storager is taking a snapshot immediately before copying the image over and not much has changed (if I understand vaguely how btrfs snapshots work...)

Code:
-rw-rw-rw- 1 recovery nasbackup 5845568491 Apr 17 16:03 home-20210417.img.gz
-rw-rw-rw- 1 recovery nasbackup 5845567506 Apr 17 17:59 xbiansnug_backup_home_2021-04-17.img.gz
-rw-rw-rw- 1 recovery nasbackup 5845568489 Apr 17 17:21 xbiansnug_backup_home_2021-04-17-1.img.gz

So...next question is to find out why the btrfs send is exiting with code 1, and, is it actually a faulty image or is it a restorable image.

Am considering line 1646 of xbian-storager:
Code:
( btrfs send -v "${tmp_dir}/home/@ro" | pv -i 20 -n -s $(du -sxb ${tmp_dir}/home/@ro | awk '{printf "%d", $1*1.08}') | $packcmd -1 >> "$FILE") 2>&1 | cpb
and redirecting the errors elsewhere rather than to "cpb" (I have no idea what cpb is!!)
Find all posts by this user
« Next Oldest | Next Newest »
Thread Closed 


Messages In This Thread
home backup files vanish - alcina - 16th Apr, 2021, 02:19 AM
RE: home backup files vanish - Nachteule - 16th Apr, 2021, 11:39 PM
RE: home backup files vanish - alcina - 17th Apr, 2021, 07:16 PM
RE: home backup files vanish - Nachteule - 17th Apr, 2021, 08:26 PM
RE: home backup files vanish - alcina - 17th Apr, 2021, 11:39 PM
RE: home backup files vanish - Nachteule - 18th Apr, 2021, 12:37 AM
RE: home backup files vanish - alcina - 18th Apr, 2021 03:33 AM
RE: home backup files vanish - Nachteule - 18th Apr, 2021, 04:14 AM
RE: home backup files vanish - alcina - 27th Apr, 2021, 06:13 PM
RE: home backup files vanish - Nachteule - 28th Apr, 2021, 09:25 PM
RE: home backup files vanish - alcina - 29th Apr, 2021, 02:55 AM
RE: home backup files vanish - Nachteule - 13th May, 2021, 11:14 PM

  • View a Printable Version
  • Send this Thread to a Friend
  • Subscribe to this thread
Forum Jump:

Current time: 12th Jun, 2025, 08:00 AM Powered By MyBB, © 2002-2025 MyBB Group.