954,234 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Recover files from Ubuntu installed on USB stick.

It's not often I start a new thread, but I've hit a bit of an unusual problem...Admittedly one of my own making...

I have a laptop with a completely dead HD, which I've been using for a while with Ubuntu 9.10 installed on a bootable 8Gb USB stick with approx 3Gb of persistent storage. I've been using it for a little while now and everything was going rather swimmingly until I ran Bleachbit to clear some space by cleaning some of the caches, but somehow it completely borked the install so it won't boot fully. (Not sure exactly how I did it. I obviously checked something I shouldn't have in Bleachbit!)

It gets to the LiveCD boot menu and I can start Ubuntu running, but beyond that there's just nothing. No splash, no desktop, just blackness. I can't even get ubuntu to boot into a command line from the menu....Like I said, Borked! (with a capital B!)

From analysing the contents of the USB stick, I can see that the liveCD contents are all there. But I can't find the home folder or any of the documents that are stored in there. But there are several large files that are approximately the right size to account for the allocated storage space for the home folder and all of the other parts of the system. So it's evidently some kind of virtual file-system that's in use. The files have seemingly arbitrary names consisting of letters, numbers and other extended ASCII characters. Bleachbit has borked parts of the VFS, but I'm hoping that the rest of my documents are still in there somewhere and are accessible.

So my question is this:
If I plug the USB stick into another Linux box, is there any way I could mount the virtual file-system to allow me to recover some of my personal projects? And if so, how?

Anyway, any help with this would be greatly appreciated.
Cheers for now,
Jas.

JasonHippy
Master Poster
769 posts since Jan 2009
Reputation Points: 590
Solved Threads: 125
 

Well, it's all academic now!
I've had no luck with my attempts to mount or open the virtual file-system that had all of my data on it, so I've just cut my losses and reformatted the USB drive and re-installed Ubuntu on it.

But I won't close this thread just yet, just in case anybody can post any insight that could be of use here should anybody else be having similar problems!

Jas.

JasonHippy
Master Poster
769 posts since Jan 2009
Reputation Points: 590
Solved Threads: 125
 

Well, it's been a considerable while since I originally posted this and nobody has actually answered the question.

However, I can report that I had similar problems with my current persistent USB install this evening. So I had another go at recovering my personal files from the USB stick and the solution is actually mind numbingly simple....Rather like I can be sometimes it would seem!

I really think you're gonna kick yourselves when you see this...I certainly did when I thought of it.

All I needed to do was:
1. Create a folder in the /media directory
e.g.

sudo mkdir /media/jas_casperfs


2. Mount the casper-rw file on the USB stick in the newly created folder:
e.g.

sudo mount -o loop /media/USBSTICK/casper-rw /media/jas_casperfs


{simultaneously rolls-eyes, facepalms and slaps head!}

Once the casper-rw file is mounted, you have access to the entire virtual drive and all of your documents!

Why didn't I think of trying that all of those months ago?? Grr!

It just suddenly occurred to me, I knew all along that Linux can mount and read most of the major filesystems from the last god-knows how long. But for some reason it never occurred to me before that casper itself is a filesystem. I never made that connection before, but as soon as I did, I figured it must be supported, so it should be possible to mount the casper-rw file like any other filesystem...

And it bloody works....Unbelieveable!

Anyway, my long journey is now over and anybody else who experiences the need to retrieve files from a persistent USB install using casper-rw will also know how to retrieve their files!

So this is finally and definitively solved!

JasonHippy
Master Poster
769 posts since Jan 2009
Reputation Points: 590
Solved Threads: 125
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: