Quantcast

Maximum PC

It is currently Wed Jul 30, 2014 3:35 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: modifying FSTAB / MTAB to boot from other
PostPosted: Mon Oct 26, 2009 5:55 am 
Thunderbird
Thunderbird
User avatar

Joined: Tue Nov 08, 2005 8:30 pm
Posts: 771
Location: Cliffside Park NJ
Hey guys,

I have a question - I'd installed Mandriva2009.1 onto a 40GB ATA drive (sda1) for almost a year now, and now I wish I'd installed it on a SATA drive instead (sdc1 in this case).

I've made disk Image of the above drive (using Acronis), and now I want to restore this on the 500GB SATA drive (sdc1) so I don't have to re-install Mandriva2009.1

If I restore the disk image to SATA, do I edit the FSTAB / MTAB and change sda1 to sdc1 in order to boot from the SATA drive ?

I'm wondering if there will be improvement running it on sata instead of ata ! My aging 40GB ATA drive has been failing alot lately and I have been 'restoring' my disk image almost once a week due to my aging ATA drive freezing.

Thanks :)


FSTAB -- this is partially of what I have right now..

# Entry for /dev/sda1 :
UUID=____________________ / ext3 relatime 1 1
# Entry for /dev/sdc1 :
UUID=____________________ /media/hd2 xfs defaults 1 2
none /proc proc defaults 0 0
none /tmp tmpfs defaults 0 0

MTAB -- this is what I have right now..

/dev/sda1 / ext3 rw,relatime 0 0
none /proc proc rw 0 0
/dev/sdc1 /media/hd2 xfs rw 0 0
none /tmp tmpfs rw 0 0
none /proc/sys/fs/binfmt_misc binfmt_misc rw 0 0


Top
  Profile  
 
 Post subject:
PostPosted: Mon Oct 26, 2009 1:43 pm 
Bitchin' Fast 3D Z8000
Bitchin' Fast 3D Z8000
User avatar

Joined: Wed Jun 16, 2004 5:29 pm
Posts: 6328
Location: Far away from you
I'm not sure this is as simple as updating your fstab (you're not making changes to your mtab btw) as IIRC, you need to create a new initrd image too

There's only two entries you have in there though. The ones with #s basically comment things out, so the only entries you're showing are /proc and /tmp. You should be interested in the ones marked swap, /, and /home


Top
  Profile  
 
 Post subject:
PostPosted: Mon Oct 26, 2009 5:11 pm 
Thunderbird
Thunderbird
User avatar

Joined: Tue Nov 08, 2005 8:30 pm
Posts: 771
Location: Cliffside Park NJ
furball146 wrote:
I'm not sure this is as simple as updating your fstab (you're not making changes to your mtab btw) as IIRC, you need to create a new initrd image too

There's only two entries you have in there though. The ones with #s basically comment things out, so the only entries you're showing are /proc and /tmp. You should be interested in the ones marked swap, /, and /home



oh yea.. i edited out the swap, /, home and 3 other partitions to make my question simpler and less clutter :)


Top
  Profile  
 
 Post subject:
PostPosted: Mon Oct 26, 2009 6:01 pm 
Bitchin' Fast 3D Z8000
Bitchin' Fast 3D Z8000
User avatar

Joined: Wed Jun 16, 2004 5:29 pm
Posts: 6328
Location: Far away from you
logicmaster2003 wrote:
oh yea.. i edited out the swap, /, home and 3 other partitions to make my question simpler and less clutter :)


Then what's your problem then? There's nothing in what you posted that needs changed if you change drives.


Top
  Profile  
 
 Post subject:
PostPosted: Mon Oct 26, 2009 9:49 pm 
Thunderbird
Thunderbird
User avatar

Joined: Tue Nov 08, 2005 8:30 pm
Posts: 771
Location: Cliffside Park NJ
furball146 wrote:
logicmaster2003 wrote:
oh yea.. i edited out the swap, /, home and 3 other partitions to make my question simpler and less clutter :)


Then what's your problem then? There's nothing in what you posted that needs changed if you change drives.


no no i think u misunderstood me. I basically want to get rid of the ATA drive (sda1) and boot-up with SATA drive (sdc1) by restoring the disk image.

I'm assuming that all I have to do is to edit the fstab, but I'm not so sure what else is needed


Top
  Profile  
 
 Post subject:
PostPosted: Tue Oct 27, 2009 6:00 am 
Monkey Federation (Top 10)*
Monkey Federation (Top 10)*
User avatar

Joined: Sun May 22, 2005 8:28 am
Posts: 3673
Location: The Blue Nowhere
logicmaster2003 wrote:
no no i think u misunderstood me. I basically want to get rid of the ATA drive (sda1) and boot-up with SATA drive (sdc1) by restoring the disk image.

I'm assuming that all I have to do is to edit the fstab, but I'm not so sure what else is needed


You will need to edit the fstab and the /boot/grub/menu.lst (assuming you are using grub) so that the system knows where to find the kernel

Code:
default=0
timeout=5
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
hiddenmenu
title RecoveryOS (2.6.23.9-6.RecoveryOS-smp)
        root (hd0,0)
        kernel /boot/vmlinuz-2.6.23.9-6.smp ro root=/dev/hda1  rhgb quiet
        initrd /boot/initrd-2.6.23.9-6.smp.img


Here is a simple example.
root (hd0,0) is HDD #1 and partition #1 (zero based)
in the kernel line you will need to edit the /dev/hda1
splashimage I put at the bottom due to low priority to be fixed; it will need to be edited the same way as the root (hd0,0) line


This is not terribly hard to do and if grub fails usually you can boot into the grub prompt and fix it. I warn you that this is also not for the timid. While not difficult once you understand it all, if you are in the middle of a problem and don't understand how it all works it is easy to become very frustrated.


An easier suggestion may be to create a .tgz archive of /home, /etc, /var, /usr, and if necessary, /bin, /sbin, and /opt. Then install a base system on the sd cdrive and restore this backup.


Top
  Profile  
 
 Post subject:
PostPosted: Tue Oct 27, 2009 8:14 am 
Bitchin' Fast 3D Z8000
Bitchin' Fast 3D Z8000
User avatar

Joined: Wed Jun 16, 2004 5:29 pm
Posts: 6328
Location: Far away from you
logicmaster2003 wrote:
I'm assuming that all I have to do is to edit the fstab, but I'm not so sure what else is needed


So do you know what to do with those entries then?

Lodis: If they remove the ATA drive, then there shouldn't be any need to change grub.

Thinking about this more though, I wonder if simply symlinking /dev/sda to /dev/sdc will be a simple solution for this.


Top
  Profile  
 
 Post subject:
PostPosted: Tue Oct 27, 2009 9:30 am 
Monkey Federation (Top 10)*
Monkey Federation (Top 10)*
User avatar

Joined: Sun May 22, 2005 8:28 am
Posts: 3673
Location: The Blue Nowhere
furball146 wrote:
Lodis: If they remove the ATA drive, then there shouldn't be any need to change grub.

Thinking about this more though, I wonder if simply symlinking /dev/sda to /dev/sdc will be a simple solution for this.


If I read what he is doing correctly the new drive will ID differently and therefore require grub edits.

He mentions a 40GB ATA drive, I assume this to be PATA, which would ID as /dev/hda.

He really needs to look at /etc/udev/rules.d/XXXXXXX.rules?? and see what his mappings are to those UUID's.If the original drive is PATA he will have to make edits to grub, if it was SATA then unplug the original drive and plug in the new one in the same port. Still might need grub edits but the odds are smaller at this point.


Top
  Profile  
 
 Post subject:
PostPosted: Tue Oct 27, 2009 9:33 am 
Monkey Federation (Top 10)*
Monkey Federation (Top 10)*
User avatar

Joined: Sun May 22, 2005 8:28 am
Posts: 3673
Location: The Blue Nowhere
I still think making a basic Mandriva install on the new drive and restoring the backups would be the simplest solution in this case.

the more I read the OP I think he is trying to go from PATA to SATA with an Acronis image. There are better ways to migrate.


Top
  Profile  
 
 Post subject:
PostPosted: Tue Oct 27, 2009 10:06 am 
Bitchin' Fast 3D Z8000
Bitchin' Fast 3D Z8000
User avatar

Joined: Wed Jun 16, 2004 5:29 pm
Posts: 6328
Location: Far away from you
yea..I'd have to see why theirs looks like.

hd0,0 is going to be the first drive in any case. The grub I use identifies root by-id..


Top
  Profile  
 
 Post subject:
PostPosted: Wed Oct 28, 2009 5:46 am 
Thunderbird
Thunderbird
User avatar

Joined: Tue Nov 08, 2005 8:30 pm
Posts: 771
Location: Cliffside Park NJ
hey Lodis4 and everybody else -- Thank you for a heads-up :)

I'll prolly do this over the weekend or early next week - I'll edit the fstab and grub, then test it out. But as a last resort, I'll just install a fresh mandriva2009.1 to SATA drive as per your suggestion :)

Thanks again and i'll let u guys know :)


Top
  Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group