Dir gone - how to get it back?

rikona rikona at sonic.net
Thu May 16 01:45:16 UTC 2013


Wednesday, May 15, 2013, 4:40:35 PM, tv wrote:

[trim]

> You could play with find like this:

> find ~ -size +0k -type f -print0 | xargs -0 sha1sum 2> /dev/null >
> SomeName.txt

Thanks. I'll have to think that through to understand what it does.
I'm not really a CLI person, but I'm slowly learning, bit by bit, as
it is needed for stuff like this.

> Command is one line, mind the email wrapping. May be further refined.

>> 
>> Other thoughts... Is there a tool that would low-level scan the disk
>> looking for the deleted dir name? If it would not take forever to do,
>> it might give a clue as the recoverability. When a dir is deleted, is
>> just the dir marked as deleted, or do all the files/dirs under it also
>> get marked as deleted? If just the dir, would it be possible to edit
>> the disk to undelete the dir?

> Look into "extundelete" man, you will find what you are looking for I
> think, like the "--restore-directory" and "--restore-files" options.

I didn't run those last time. I was in full panic mode and was able to
get help. But next time, I may be more on my own, so it's 'learnin
time I guess. :-)

>> 
> [trim]

>> When I tried that from the live-cd, it says only root can mount the
>> disk. The disk utility can mount/unmount it though. What do 'I' have
>> to do to mount it ro?

I tried this first since I couldn't originally mount it via CLI, but
could with disk utility -

> If it has been automatically mounted (bad for recovery), remount it ro:

> sudo mount -o remount,ro /mountpoint

This did work when I used the long, complex mountpoint reported by the
utility, and it verified as ro, so that worked. Since that worked, and
it seemed I had to get the mountpoint right, I tried this-

> Which live-cd ? From an Ubuntu live-cd just use:

> sudo mount -o ro /dev/your-device-partition /mountpoint

This did work - but, I had to specify the full location, back through
the somewhat odd tree back to / on the live-cd. [I didn't do that
originally.] And I first had to make the simpler mountpoint name
before it would mount.

>> The disk is new - could this bring in the possibility of an early
>> failure even if 'smart' reports no problems?

> It wouldn't be the first time a new disk fails ! But if "smart" or
> "badblocks" doesn't complain it's probably not the case, unless the disk
> is too new and as a weird smart implementation.

> HIH

Thank you VERY much for the detailed info! It helped a lot. I don't
know much about the 'guts' of Linux, so each of these 'adventures' is
a learning experience. [My big problem is remembering *exactly* what I
did, 2-3 years from now, when I might have the same situation again.]

-- 

 rikona        





More information about the ubuntu-users mailing list