Botched Update to 13, Looking to Retrieve Files

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read this

Botched Update to 13, Looking to Retrieve Files

Postby Timecrash on Sun May 27, 2012 8:03 pm

Hi all,

On Friday night, I was trying to upgrade my 64-bit installation of Mint from 12 to 13, through APT. Yes, I know this was a bad decision, but hindsight is 20/20. I should also point out here that I'm a relative newbie to Linux, having limited experience with Ubuntu in the past few years.

Unfortunately, the process was interrupted by the computer shutting down. Before I was able to back up my important files, which were essentially just my Pictures folder. As I expected, my machine wasn't able to boot up at all, so I had to use the LiveCD on a USB drive to try to save my data. For some reason, however, I wasn't able to access the computer's Home directory, and when I tried to open it as an administrator, it said it was separated to another partition to preserve the data, which appears to be just the main partition. It didn't make much sense to me, but I can transcribe it here if need be.

Anyway, after doing some research on my situation, I downloaded Testdisk on my LiveCD and used PhotoRec to try to recover my files, and after four hours all 172,684 .gif, .jpg, and .png files on my hard drive were recovered, which is obviously a heck of a lot more than what I was expecting.

I suppose what I'm trying to ask is, is there any other conceivable way I can back up my Pictures through the LiveCD, or was this about it? I'm not exactly looking forward to sorting through all these images, but it is most certainly better than losing them all.
Timecrash
Level 1
Level 1
 
Posts: 9
Joined: Sun May 27, 2012 3:31 pm

Linux Mint is funded by ads and donations.
 

Re: Botched Update to 13, Looking to Retrieve Files

Postby stratus_ss on Sun May 27, 2012 10:44 pm

You actually can probably rescue your system with a liveCD, but to your point, you should be able to load a liveCD and retrieve your info

If you are interested in me walking you through rescuing your system just post back here
stratus_ss
Level 4
Level 4
 
Posts: 224
Joined: Fri May 25, 2012 5:22 pm

Re: Botched Update to 13, Looking to Retrieve Files

Postby Timecrash on Sun May 27, 2012 11:25 pm

Normally I'd use a LiveCD, but back when I was installing Mint 12 in the first place, for some reason the DVD wasn't loading properly on the boot menu. I'd get the Linux Mint screen, but it would just sort of freeze up and I wouldn't actually be able to load the OS. I've been using a bootable USB stick so far, and that's worked out pretty well. Would your method still work on that, or would it have to be the LiveCD? I'm interested in hearing what you'd have to say, regardless.
Timecrash
Level 1
Level 1
 
Posts: 9
Joined: Sun May 27, 2012 3:31 pm

Re: Botched Update to 13, Looking to Retrieve Files

Postby stratus_ss on Sun May 27, 2012 11:41 pm

any method where the root partition isnt actively in use works just fine so a usb key would work.

I am about to head in for the night but here are the basic steps for repairing your system

Code: Select all
sudo -s
mount /dev/_your_root_partition /mnt
mount -o bind /dev/ /mnt/dev
mount -o bind /proc /mnt/proc
mount -o bind /sys /mnt/sys
chroot /mnt /bin/bash
apt-get update
apt-get dist-upgrade -y


What this basically does it mounts your root partition but uses the live environment for networking etc etc to get a stable environment. Then we change root (chroot) to /mnt so that the computer understands the following commands are to be done on your root partition and not the live environment. If you have your sources.list set correctly this should continue your upgrading process via apt

For reference here is my sources.list
Code: Select all
deb http://packages.linuxmint.com/ maya main upstream import
deb http://archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu/ precise-security main restricted universe multiverse
deb http://archive.canonical.com/ubuntu/ precise partner
deb http://packages.medibuntu.org/ precise free non-free

deb http://archive.getdeb.net/ubuntu precise-getdeb apps
deb http://archive.getdeb.net/ubuntu precise-getdeb games
deb http://download.virtualbox.org/virtualbox/debian precise contrib


Additionally you may need to tell apt to fix/force the current packages

Code: Select all
apt-get -f install


Hope this helps
stratus_ss
Level 4
Level 4
 
Posts: 224
Joined: Fri May 25, 2012 5:22 pm

Re: Botched Update to 13, Looking to Retrieve Files

Postby Timecrash on Sun May 27, 2012 11:46 pm

I'm turning in for the night, too, but I'll definitely try this first thing tomorrow. Thanks a lot!
Timecrash
Level 1
Level 1
 
Posts: 9
Joined: Sun May 27, 2012 3:31 pm

Re: Botched Update to 13, Looking to Retrieve Files

Postby Timecrash on Mon May 28, 2012 11:52 am

Well, I've done this method, but when using apt-get update and apt-get dist-upgrade, I've been hit with the following error:

Code: Select all
Err http://archive.ubuntu.com/ubuntu precise/main docbook all 4.5-4ubuntu1
Something wicked happened resolving 'archive.ubuntu.com:http' (-5 - No address associated with hostname)


The computer is connected to a wired connection, and I copied the sources list right from your post, but I've been hit with this error with most of these packages.
Timecrash
Level 1
Level 1
 
Posts: 9
Joined: Sun May 27, 2012 3:31 pm

Re: Botched Update to 13, Looking to Retrieve Files

Postby stratus_ss on Mon May 28, 2012 12:57 pm

ok, did the live environment get an IP from your router?
Can you surf the web from the live environment?

usually this error occurs when it cant find the network connection

You can also exit the chroot (by typing "exit")
then
Code: Select all
cp /etc/resolv.conf /mnt/etc/
chroot /mnt /bin/bash


This will copy the network settings to the changed root environment
stratus_ss
Level 4
Level 4
 
Posts: 224
Joined: Fri May 25, 2012 5:22 pm

Re: Botched Update to 13, Looking to Retrieve Files

Postby Timecrash on Mon May 28, 2012 1:20 pm

I can surf the internet, so I assumed the live environment would be able to connect to the internet okay.

The command you listed is saying that it can't find the file, when it's listed right there in the file manager.
Timecrash
Level 1
Level 1
 
Posts: 9
Joined: Sun May 27, 2012 3:31 pm

Re: Botched Update to 13, Looking to Retrieve Files

Postby stratus_ss on Mon May 28, 2012 1:24 pm

Can you copy this file instead?

/run/resolvconf/resolv.conf
stratus_ss
Level 4
Level 4
 
Posts: 224
Joined: Fri May 25, 2012 5:22 pm

Re: Botched Update to 13, Looking to Retrieve Files

Postby Timecrash on Mon May 28, 2012 1:28 pm

I'm afraid I can't, though I do see it in the file manager.
Timecrash
Level 1
Level 1
 
Posts: 9
Joined: Sun May 27, 2012 3:31 pm

Re: Botched Update to 13, Looking to Retrieve Files

Postby stratus_ss on Mon May 28, 2012 2:21 pm

alteratively if you can open the file you can copy and paste into a new file

so if you did
Code: Select all
sudo gedit /mnt/etc/resolv.conf


And then copy the contents of /etc/resolv.conf into it, save and exit

chroot back into the /mnt and see if you can ping google or something
stratus_ss
Level 4
Level 4
 
Posts: 224
Joined: Fri May 25, 2012 5:22 pm

Re: Botched Update to 13, Looking to Retrieve Files

Postby Timecrash on Mon May 28, 2012 3:50 pm

Both files are exactly the same, and after copying the text over anyway, Terminal isn't able to ping Google; it keeps calling it an unknown host.
Timecrash
Level 1
Level 1
 
Posts: 9
Joined: Sun May 27, 2012 3:31 pm

Re: Botched Update to 13, Looking to Retrieve Files

Postby stratus_ss on Mon May 28, 2012 3:57 pm

can you paste the output of mount from the live environment and not the chroot environment please
stratus_ss
Level 4
Level 4
 
Posts: 224
Joined: Fri May 25, 2012 5:22 pm

Re: Botched Update to 13, Looking to Retrieve Files

Postby Timecrash on Mon May 28, 2012 4:14 pm

Well, have I some news for you. While I was trying to run apt-get update and apt-get dist-upgrade, I ran another command, though unfortunately I don't recall what it was, and it was too far back in Terminal to be recorded. What I believe it did was rebuild some broken packages in my installation, and on a whim, I restarted my computer and tried to boot up my screwed-up installation of Mint. To my surprise, it booted up, though most everything looks broken and barely functional. It looks like some strange, Frankensteinian mashup of Mint 12/13 and Ubuntu, but it worked enough for me to back up my Pictures folder onto my external. I'm going to be installing Mint 13 properly from my USB stick, which should hopefully fix everything.

I'd like to thank you so much for your help, stratus_ss! I would have had no idea what to do otherwise, and I'll definitely keep all this in mind in case anything like this ever happens again! Granted, I learned a lot from this, but you never know what might come down the road.
Timecrash
Level 1
Level 1
 
Posts: 9
Joined: Sun May 27, 2012 3:31 pm

Re: Botched Update to 13, Looking to Retrieve Files

Postby stratus_ss on Mon May 28, 2012 4:54 pm

glad to help!

It may have been apt-get install -f that did the trick... at any rate glad you are happy
stratus_ss
Level 4
Level 4
 
Posts: 224
Joined: Fri May 25, 2012 5:22 pm

Re: Botched Update to 13, Looking to Retrieve Files

Postby Timecrash on Mon May 28, 2012 4:56 pm

I believe that was the one. Certainly useful in a case like this.
Timecrash
Level 1
Level 1
 
Posts: 9
Joined: Sun May 27, 2012 3:31 pm

Linux Mint is funded by ads and donations.
 

Return to Installation & Boot

Who is online

Users browsing this forum: No registered users and 17 guests