LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-04-2016, 07:41 AM   #1
judoka
Member
 
Registered: Jul 2009
Distribution: Ubuntu 14.04 LTS, CentOS
Posts: 218

Rep: Reputation: 16
Unhappy HELP: How do I restore all my files that got erased by "apt-get dselect-upgrade" after failed upgrade from 32 to 64 bit Ubuntu 14.04 LTS


I'm running a 32-bit Ubuntu 14.04 LTS OS, but decided to switch to a 64-bit version so I found this tutorial online. http://www.ewan.cc/?q=node/132 Everything seemed to go okay until step 7 in which, after command "apt-get dselect-upgrade" I saw that all of my files began to be erased. I didn't want to stop the process but all my programs were being removed until I had nothing visible on the unity taskbar and even the text in my terminal turned into rectangles. Now I cannot read anything and afraid to reboot or turn off the machine. But more importantly was wondering if there is a way to undo what I just did or reinstall at least the main core of 14.04 LTS. I think what happened is when running commands in step 2, I didn't see any output ie no packages were included and so "apt-get dselect-upgrade" started erasing everything. There is a post in the discussion sections that talks about this. It's posted by "Matthias Loidolt" and another by "rizpan". So I still have the terminal and even though letters are just rectangles it seems to still execute commands, so I still think there is a chance. I'm really scared I might have erased my whole OS and backup kernels (since I "painfully" watched them being removed from my system) I just want to undo everything that I did when I ran "apt-get dselect-upgrade" is that possible?

Last edited by judoka; 03-04-2016 at 07:47 AM.
 
Old 03-04-2016, 07:44 AM   #2
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Did you not make a backup of your system on another partition/drive before undertaking the upgrade procedure?

If not, why on earth not?

Edit: Also, do you have your /home backed up? If so, I would just start again and install the 64-bit version from scratch. Even if you don't, and as long as you at least have your documents and data files backed up, I would do this.

Edit2: Given how he produced the tutorial, and is so knowledgeable about the process, have you tried contacting Ewan through the form on his site?

Last edited by hydrurga; 03-04-2016 at 07:51 AM.
 
Old 03-04-2016, 07:49 AM   #3
judoka
Member
 
Registered: Jul 2009
Distribution: Ubuntu 14.04 LTS, CentOS
Posts: 218

Original Poster
Rep: Reputation: 16
I tried but it required about 1 TB of space which I don't have. I backed up my files on another hd but not my home or the files that were on my disk since there was over 1TB of stuff. But I noticed that the files were not erased it was just the core files, so the data is still there (somewhere) I just need a way to restore the core 14.04 files so I figure since I still have the terminal available there could still be a chance.

Per Edit2 by hydrurga: Yes, I will add a comment there as well.

Last edited by judoka; 03-04-2016 at 07:57 AM.
 
Old 03-04-2016, 07:55 AM   #4
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by judoka View Post
I tried but it required about 1 TB of space which I don't have.
There are backup programs that compress data - you could have probably done it with less space. There is no way that the ordinary filesystem uses 1TB though - the vast majority of that must be documents, music, videos etc., in which case they should really be stored on a separate partition/device to make backing up and restoring of / (and /home) much easier.
 
Old 03-04-2016, 07:59 AM   #5
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Contact Ewan (not just by leaving a comment, by directly emailing him through the form).

Personally, however, I think that the system sounds too guddled now.

Find as much of your data as you can, back it up, and then reinstall, is my advice.

Last edited by hydrurga; 03-04-2016 at 08:01 AM.
 
Old 03-04-2016, 08:14 AM   #6
judoka
Member
 
Registered: Jul 2009
Distribution: Ubuntu 14.04 LTS, CentOS
Posts: 218

Original Poster
Rep: Reputation: 16
How would I find the data? I can't read the terminal it's just bunch of rectangles, I need to install something so at least I can read the text in the terminal.
 
Old 03-04-2016, 12:05 PM   #7
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by judoka View Post
How would I find the data? I can't read the terminal it's just bunch of rectangles, I need to install something so at least I can read the text in the terminal.
Have you tried recovery mode?

https://wiki.ubuntu.com/RecoveryMode
 
Old 03-04-2016, 12:12 PM   #8
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243
Think outside the box

when you say loss your data, you're talking about the OS or personal data?

Quote:
as you say it seems to still be taking commands even though you cannot see what you typed. But you know what you typed because the keyboard it right in front of you.

Therefore, if you can get to a terminal one way or another then just issue the key strokes hit enter,
did you try switching to a different tty?
Code:
alt+ctrl+F1- F6
then see if you have readable characters. I do believe you may have to log back in as well. Ubuntu does not have a root account,(which is crap in my book) but, personal options aside. if you have a network connection still, and depending on what is left of your system. You may, if it is personal data you're trying not to lose, then connect an external HDD to a USB port and just
Code:
mv -v source destanation
if it is just your home directory then
Code:
mv -v /home /dev/sdxx
then you'd have all of your complete home directory with your personal files, and any conf files within your account, so you'd not have to redo a lot of stuff, just reuse it when you just install a fresh copy of Linux of your choice.

But as you say it seems to still be taking commands even though you cannot see what you typed. But you know what you typed because the keyboard it right in front of you.

Therefore, if you can get to a terminal one way or another then just issue the key strokes hit enter,cross your fingers and it sould work if the system can still move files. if not then try cp .. if not then try
Code:
rsync -r /home/ /dev/sdxx
if you had that, if that does not work then read this and hopefully you can try that too

6 Examples to Backup Linux Using dd Command
or this one
Moving your data to a backup device
might not work but it maybe worth a look
SCP uses secured shell (ssh) to transfer the data between...

if off board space is an issue then if you know your file structor then just move the most critical data the whole folder/directory that you cannot replace (over time), and abandon the rest.

furthermore,

if you can get a live USB with gparted on it or in the linux OS be easier better actually because you're going to need more then just Gparted in this scenario.

Dumping the system in a reboot will not matter, as you said .... Me, I'd just kiss that OS good-bye. Your personal Data should be ok. As the only thing taking place was a system (failed) upgrade. It should not have touched your personal data to corrupt it in anyway.

Reboot with a live Linux OS that has gpared. To save your personal data using gparted resize your HDD srink it as much as you can on the data side, but not too much so you can reuse it.

Then when it is finished. take that now new space and create a new partition. format it, then move as much of your personal data onto it as you can. But, first using the file structor as such.

create a home directory, then another directory using your userName then if you want create the file structor within your new userName directory, Documents, Movies, etc. then move all or as much of your data you can. then the rest to an external drive.

now you have it seperated, and placed into a home dir set up.
so now you can wipe the other partition, then upon re-installing. size wise hopefully you should still have enough room on the old partition to just re-install your new system, only this time seperate it. using the old partition for just root, and the new one for home/users

Code:
/
/home
then during install just link the partitions mount point with your newly created /home to it and tell the install to NOT format.

this way it will use that as your /home already there as if it was in the frist place.

then when you add your user name you'll should just only get the error/warning user directory already created, but still the system will attach your user to that directory.

then after that is all said and done with a new OS set up seperate / and /home you can still resize using Gparted if need be while your in the new OS.

if size restrants avert you from that scenario then go the other way...

if your HDD is way to full to move most if not all of your personal data to the new partiton in that last scenario. Then hopefully it will still have enough room to still resize it, just enough to make a new partition of about 50GB maybe to much ???

mine is 75GB, nevertheless you'll need enough to get a new OS installed on it and if you can give a little more for growth.

Depending on you. If you take from the front it will have to move all of that data to the back to free up the front. if you just take from the back then time wise it should be faster. but think of the aftermath, your new OS will be running on the back end of your HDD. meaning the outter part of your disk means longer seek write times. milliseconds wise but still it is longer, then seeking and writing closer to the center of the platter.

the choise is yours of course.

but, the objective is the same, to split your HDD so you will have enough room to install a new system onto it without Personal data loss.

doing it this way you'll have what is left of your entire old system and personal data to deal with after words.

Logically, and theoretically in my mind this should still work.

If you still split the root / and /home when you install a new system onto your newly created partition using just / (root) and then when you tell it mount point for your /home the new system should still link just the /home that is already there to itself. Everything should be copesthetic in that respect the same would apply when you add your userName in the new OS.

then you'd just see what was left over from your mishap and will be able to just delete it from inside of your new OS. leaving your /home alone, and the left over or regained space would just be absorbed by the /home directory.

I hope you're getting my line of thought here.
if not let me know...

note:

I have as well as I am sure others have done dual boots and linked the same home to both OS's. I tell you this to let you better understand the logic behind the second scenario in that it should more then not work.
---
I see my line of thought went from saving the system to screw the system and save your personal data...

Last edited by BW-userx; 03-04-2016 at 03:33 PM.
 
Old 03-04-2016, 03:29 PM   #9
judoka
Member
 
Registered: Jul 2009
Distribution: Ubuntu 14.04 LTS, CentOS
Posts: 218

Original Poster
Rep: Reputation: 16
Thank you for such a detailed answer. I decided to just reinstall new OS (Ubuntu 14.04 LTS) but would like to save the data that is already there. I tried to follow your advice but I'm not sure what to do.
This is what I see in terms of the partition I want to replace.
Code:
               size      used 
/dev/sde1      999 MB
/dev/sd5e ext4 999202 MB 781583MB Ubuntu 14.04 LTS
I would like to save all of 781583 MB and just replace the boot and core Linux files such as /usr/bin which got erased previously. Is there a way to do that?

You said to "To save your personal data using gparted resize your HDD srink it as much as you can on the data side, but not too much so you can reuse it. " I'm not sure how to go about that or what "HDD srink" is, I also not sure how to do what you said about "file structor" in here: "Then when it is finished. take that now new space and create a new partition. format it, then move as much of your personal data onto it as you can. But, first using the file structor as such." So I can't really proceed.
 
Old 03-04-2016, 04:17 PM   #10
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243
Quote:
Originally Posted by judoka View Post
Thank you for such a detailed answer. I decided to just reinstall new OS (Ubuntu 14.04 LTS) but would like to save the data that is already there. I tried to follow your advice but I'm not sure what to do.
This is what I see in terms of the partition I want to replace.
Code:
               size      used 
/dev/sde1      999 MB
/dev/sd5e ext4 999202 MB 781583MB Ubuntu 14.04 LTS
I would like to save all of 781583 MB and just replace the boot and core Linux files such as /usr/bin which got erased previously. Is there a way to do that?

You said to "To save your personal data using gparted resize your HDD srink it as much as you can on the data side, but not too much so you can reuse it. " I'm not sure how to go about that or what "HDD srink" is, I also not sure how to do what you said about "file structor" in here: "Then when it is finished. take that now new space and create a new partition. format it, then move as much of your personal data onto it as you can. But, first using the file structor as such." So I can't really proceed.

/dev/sd5e is your boot with Ubuntutu on it yes?

(I've never seen /dev/sd5e I had to go look that one up. lol ccdconfig(8) - The FreeBSD Project )

but it look to be the same method as
Code:
/dev/sda1
/dev/sda2
/dev/sdb1
etc
look like it is just different naming scheme.

nevertheless,
if that'd be your OS then looking at it /dev/sd5e you have aprox 217,519 MB left to play with. easy peasy. Pleany of room to play with. Using the second scenario.

1. If you take it off of the front of your HDD it is going to take a Long While to move all of that Data.

2. To save time using the back end where it will already be free of data, so Gaparted doing what it needs to resize the drive will not take as long.

You can then create a partition for installing just your Operating System still using the front end of your hard drive with your 'old' system and home on it.Then just tell the new install to use it for the /home mount point.

Now the only thing you have to think about is which end of the hard drive you want to use.

No longer having to worry about creating a new /home/user/. Just creating a new partition using Gparted.

Using your live boot USB Stick with Gparted. Ensuring that the Live Boot Linux does in fact have gparted on it before starting.

Code:
sudo dd if=Nameof.iso of=/dev/sdc && sync
be sure that /dev/sdc is in fact your USB Stick you'll be using.

after you've booted into the live OS with Gparted on it.

Quote:
1. open Gparted. let it scan everything. then when it stops.
2. select your /dev/sd5e partition. then when you see it portrayed in a bar type.
3. right click on the bar. select 'resize/move' a new window will pop open.
4. looking at this <=================> with arrows on both sides. Grab one side with your mouse, then slide it towards the middle. you'll notice that this changes the size, or srinks the partition.

Taking from the left side is moving the slider to the center. this is moving your old OS, and all whatever data. This will take time to move everything that is written on the disk and place it on to the free space. inner area of your platter.

Moving starting from the right side will take it from the outer edge of the platter and move it towards the center. Freeing up what little data is written there. Takikng less time because the right side of your free space.

it goes left to right in data representation.

Moving the slider right to left, will take less time, probably safer because it does not have to move your data. Less chance of it crasing or malfunctioning. But your OS will be on the outter side of the platter.

5. Now all you have to do is move it far enough to give yourself enough room to install the new OS and I'd give it a little more to stay on the safe side.

When you are done moving the slider. Keeping an eye on the numbers. If you move from right to left, besure to keep the top number at Zero 0 as best you can. The bottom number is the new size of partition you are creating in MB.

and visa versa, Left to right bottom number try to keep it at 0 best as you can if it moves. move it back to zero as best to can get it to zero.

Top number is the size of the new partition.

6. when you've completed this, then click 'ResizeMove'
7. check everything to be sure it is the size you want. if yes, click the Green Check mark. If you agree then click the apply on the next window that pops up. Let it complete its operation. It will tell you when it is done.

8. Now you will see the free space. Right click on it, then select 'New'.
9. then click 'Add' using the whole space.
10. again click the Green Arrow.
11. agree if you are ok with it.
12. it will tell you when it is completed.

you can now reboot into an install usb.
remember the sizes and or the /dev/sda or what ever the partitons where called. you'll be needing that information during install so you will not use the wrong partiton when installing your OS.


UBuntutututu right?

when you get to the partitons part of install, pick, something different.

then find the new partiton you just created. follow the prompts in selecting it, telling it mount point which is
Code:
/
it should mark it for formatting, what ext is up to you ext4 is the most common.

then when you get to your next partition on that same hard drive, which is your old OS with /home on it. Just tell it mount point /home and what ext it already is.

Then there is this little area check box, or was when i was playing with Ubuntututu. that tells it to format or not. besure that check box is not checked so it will not format that partition.

you just need to direct the install program where to mount that partition which is /home and what ext it already is formated to. And be sure it says to NOT format it.

check all of the other partitions, even on your other drive.

I'd have Ubuntututu leave them alone 'do not use' and fix that in fstab afterwords.

then proceed with install.

after your finished, I'd back up or move your data and get my system ready for another fresh install so I can put it at the center or front of my hard drive. Using this install as a save my data install. but that is me.

it should and probably will operate just fine like that though.


if you want fast and easy and keep it like that senerio.

I'd just use Gparted to move the right side to the left and give me 100GB then partition it. Install Ubuntu on it.

Code:
/
then mount the /home using the prior instructions.
then delete the old system, letting /home absorb the free space.

then when you find some free time, then just resize that /home partition to take up the rest of the left over space that you will have from all of the free space you had in the ~200GB space before partitioning and installing Ubuntu. The left overs that is.

this is not taking into account a swap drive. you can just use the old one if you had one already.


any questions ?
did I miss anything?

Last edited by BW-userx; 03-04-2016 at 06:45 PM.
 
1 members found this post helpful.
Old 03-05-2016, 05:59 PM   #11
judoka
Member
 
Registered: Jul 2009
Distribution: Ubuntu 14.04 LTS, CentOS
Posts: 218

Original Poster
Rep: Reputation: 16
Thank you BW-userx, you give great instructions that even an armature like me can follow. I did everything as you explained up to rebooting the system but now I'm faced with
Code:
grub rescue>
and when I do:
Code:
grub rescue> ls
I see:
Code:
(hd0) (hd0,msdos6) ... (hd0,msdos1) (hd1) (hd1,msdos1) ... (hd4,msdos1)
I read another post here http://askubuntu.com/questions/49382...untu-partition and I tried for example:
Code:
ls (hd0,msdos6) /boot
but only got:
Code:
(hd0,msdos6): Filesystem is unknown.
I did this for all of the ones listed with the same result.

In the post KillBill says that he
Quote:
... fixed it by login in through a live USB and issuing 'update-grub' command
But I'm not sure how to do that since I have a lot of hard drives and the one that I reinstalled on by following your instructions is '/dev/sde'. Would you know how to go about it, and if so could you explain it in the same (really helpful and comprehensible) way how one like myself would go about it?

P.S.
What I think caused this is when I reinstalled Ubuntu 14.04 64-bit as you instructed, I rebooted and it booted into the broken 32-bit boot, which I couldn't use. So I loaded live CD and erased /boot folder from the /dev/sde3 partition that contained my 32-bit broken boot folder, since I figured that the old /boot interfered with the new installation and now the new boot folder that's in the new "formatted" partition /dev/sde4 would take over. But that didn't happen and I was faced with the terminal that said:
Code:
grub rescue>
 
Old 03-05-2016, 06:03 PM   #12
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243
please keep this in your other post, so we don't keep jumping between post.

and mark this one solved, and use your other post for help with this new issue you are now experiecing . please and thank you

http://www.linuxquestions.org/questi...ve-4175574005/
 
  


Reply

Tags
dselect-upgrade, failed 64-bit upgrade, restore, ubuntu 14.04


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Ubuntu 12.04 LTS: upgrade to 14.04 LTS failed, half-ready state SuSE_Lamer Linux - Desktop 9 08-23-2015 05:42 PM
"dpkg error in --configure" in most all (508) programs after "apt-get dist-upgrade" fluffymuffins Debian 3 08-09-2010 04:47 AM
apt-get dist-upgrade and Synaptic "smart upgrade" show different results vharishankar Debian 1 04-09-2006 08:53 AM
How to use synaptic "smart upgrade or "apt-get dist-upgrade" PenguinMolester Ubuntu 2 04-04-2005 03:11 PM
how to install the "packages that have been held back" when doing "apt-get upgrade&qu zero79 Debian 5 06-27-2004 09:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration