LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 04-08-2013, 08:43 AM   #1
Cougar!
LQ Newbie
 
Registered: Apr 2013
Distribution: OpenSuSE
Posts: 10

Rep: Reputation: Disabled
How to restore Linux on different partition?


Hi All,

I'm a fresh user of linux. Recently my HDD got bad track and I replaced it with a new one. Originally my partition is:

/dev/sda2 mounted as /boot
/dev/sda5 mounted as /
/dev/sda6 mounted as /usr

Now I want to merge the three partitions i.e.

/dev/sda1 mounted as /

How to do that by editing /boot/grub/menu.lst and /etc/fstab? I use Grub 0.97 so I'm afraid the article "Fix boot failure after restore partition to a different partition with Clonezilla"(http://www.linuxquestions.org/questi...la-4175411303/) can't help me.
 
Old 04-08-2013, 11:42 AM   #2
bryanl
Member
 
Registered: Dec 2003
Posts: 96

Rep: Reputation: 35
some 'been there, done that' guru will likely show up soon, but till then, here's what I see as the challenge:

Set up the new drive and restore all files to the new partition. Your old root partition should have boot and usr mount points you can restore the boot and usr partitions to on the restore. In your new root, edit /etc/fstab to remove the /usr and /boot mounts. You will also need to replace the old drive partition UUID for the root partition with the new one.

Then you'll need to re-install GRUB - see http://tcl.leipper.org/2009/05/restoring-grub/ for a couple of links on how to do this. This is basically just running the GRUB install program with parameters that tell it the target install partition. Editing the grub menu just won't do it as the boot sector code has to be able to find the /boot partition that has the menu in it and other boot files. The way that code gets updated is via the GRUB install utility. (see 'info grub-install' )

good luck, have fun!
 
Old 04-08-2013, 11:58 AM   #3
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Centos6.3/Debian
Posts: 2,175
Blog Entries: 1

Rep: Reputation: 326Reputation: 326Reputation: 326Reputation: 326
Hi Cougar!

What have you done so far
 
Old 04-08-2013, 12:49 PM   #4
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 16,989

Rep: Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447
what operating system is this ?

if you are using grub legacy ( grub 0.97 )
the /boot will likely need to be formatted to ext2
with / and /usr ( not needed ) partitions as ext3

/ and /usr can be merged , but it is likely much easier for you to just reinstall and not make a /usr partition
then move over your data from the back up
 
Old 04-08-2013, 12:50 PM   #5
goumba
Senior Member
 
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Back to Debian, and only Debian.
Posts: 1,144
Blog Entries: 7

Rep: Reputation: 321Reputation: 321Reputation: 321Reputation: 321
As well as reinstalling grub, you'll have to make sure any UUIDs or label names have been updated in grub's configuration, as well as in /etc/fstab (as stated above). You did not mention what distribution you are using. If you're lucky enough to be using a Debian based distro (Debian, Ubuntu, Mint, for starters), just run dpkg-reconfigure grub-pc as root (inside the chroot environment as desribed above) to reinstall and set up the menu. If you're running on an EFI system, you'll need to run dpkg-reconfigure on the appropriate grub-efi package.

Last edited by goumba; 04-08-2013 at 12:53 PM. Reason: (spelling... ugh)
 
Old 04-09-2013, 06:06 AM   #6
Cougar!
LQ Newbie
 
Registered: Apr 2013
Distribution: OpenSuSE
Posts: 10

Original Poster
Rep: Reputation: Disabled
I edited /boot/grub/menu.lst , changing root=/dev/disk/by-id/ata-Hitachi_...-part5/6 to part1 and I edited /etc/fstab , and the OS booted successfully! Thanks everyone!

Last edited by Cougar!; 04-17-2013 at 12:38 AM. Reason: New condition
 
  


Reply


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
Fix boot failure after restore partition to a different partition with Clonezilla heronlin LinuxQuestions.org Member Success Stories 2 06-13-2012 10:18 PM
Ping Linux unable to restore backup on NTFS partition casigui88 Linux - Newbie 4 07-23-2010 04:33 PM
moving linux - restore partition bayougrizz00 Linux - General 3 05-28-2007 12:05 PM
Need to backup then restore a linux partition stuart Linux - General 5 07-16-2004 08:30 AM
Why can't I restore a partition table backup containing a reiser partition? oldweasel Linux - Software 2 05-23-2004 01:11 AM


All times are GMT -5. The time now is 11:32 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration