[ALUG] Recovering from ext4 corruption, logs & rsync help

steve-ALUG at hst.me.uk steve-ALUG at hst.me.uk
Mon May 22 10:52:34 BST 2017


Hi gurus!

Request for help below.  First, what happened.

I had made a copy of some music files/directories I wished to copy to my 
phone using pcmanfm (I think) but mid copy I got errors "Can't write to 
readonly filesystem".

Thinking this meant that probably my main drive had errored somehow and 
switched to read-only mode, I decided to reboot, via the shutdown menu.

OOPS.

Machine would then not boot.  It tried to do a on-book fsck, which 
crashed, but if I interrupted the fsck, it also crashed.

I found a live cd, booted from it, loaded mdadm and reassembled my raid 
arrays then fscked my two partitions /, /home.

Errors were found and fixed.  Basically some inodes multiplly claimed, 
and a few reference counts were wrong.  Files were placed in Lost + Found.

Rebooted & booted OK.  Worked out all the lost & Found files were jpgs 
from my photo albums.  sorted them all out.

Rebooted again, but sometimes my desktop won't appear, & I'm left at a 
text loging prompt.

Q1) If the desktop doesn't appear, which log files to examine? Dmesg & 
xorg.*.log?

Q2) Any ideas which log files I should check to try and work out what 
went wrong yesterday?  I can't see anything obvious in Kern.log - just a 
few UFW entries then stuff from when I next booted it.


I backup my files via various methods, but one is an Rsync to a USB 
drive.  I backup using

sudo rsync -av --del / /media/me/USBDrive/ 
--exclude-from=/home/me/rsynchbackexclude

rsynchbackexclude is a text file containing stuff like
/sys/*
/dev/*
/proc/*
/media/*
/mnt/*
/tmp/*
/lost+found/*
/var/tmp/*
*.iso

I want to "compare" the backup with the live hard disk and see what, if 
anything, is missing.  If anything is missing I'll restore if from a 
different backup source though.
I suspect that I need to do a "dry-run" copy from the USB drive to the 
live hard disk

q3) Am I right with this command line to do a "dry run" restore, i.e. 
show me what would copy, which is in effect, what is different between 
the USB disk and the live drive?

sudo rsync -av --dry-run /media/me/USBDrive/  / --log-file=LogToFile

-v = verbose
-a = -rlptgoD
=>r recursive
l copy links as symlinks
ptgo preserve permissions, times, group, owner
D preserve device files & special files

--dry-run = do a dry run
--list-only = list changes but don't do any
--log-file log to file

is this right, or should I do i = itemise changes instead of dry-run?

Any help/advise welcomed.

Thanks
Steve





More information about the main mailing list