How to clone HD when using Device ID in fstab?
Hey, I have 2 HDD, exactly the same, Seagate 500Gb 7200.11. I want to use my 2nd as a full backup/clone of the primary one.
After spending 8-10hours playing around with DD commands, CP, FDISK, fstab, mounting, umounting, etc., I figured out why my 2nd hd was never booting. When I installed linux (openSUSE64) I chose the worst option for recognizing the partitions and mounting file systems: Device ID. This means in my fstab I have something like this: Code:
/dev/disk/by-id/scsi-SATA_ST3500320AS_5QM04K05-part1 / etc... Well, upon startup, after grub when the OS loads all the devices and drivers, it still looks around for 5QM04K05 and it does not find it (which is ok cuz I have disconnected the drive to troubleshoot the issue of not booting from my 2nd HDD). So now I am stuck, cuz if i clone my HD and it breaks sometime, yes my 2nd HD will be usable as a backup and my root image (I use g4l to backup my first partition) could be restored on the HD, but since the Device IDs will differ I will never be able to boot up no matter the other HD I would be using. What are my options? Where else can I change my Volume IDs on my 2nd HD besides fstab? Should I use the OS's partitioner to change the fstab options for device path, say, instead of device ID? Any ideas? tnx |
Is the second hard drive also listed in fstab, with UUIDs? If so, when you make the clone, edit the /boot/grub/menu.lst in the clone to point to the kernel and initrd on the second drive for a bootable OS. If the UUIDs are used in menu.lst, copy the UUIDs for the second drive from /etc/fstab and paste them into menu.lst.
Grub probably has information pointing to the first drive in the MBR, so, in the event of failure of the first drive, it would be necessary to boot a liveCD, mount the second drive, chroot into it, and run grub setup so the MBR points to the second drive. |
That's not a UUID - if you did use UUID, the UUIDs would be the same. So much for Universally Unique ...
Personally I stay away from labels and UUID (and the like) - I simply still use the device designation for everything. Only other place you should have to look is the boot-loader - but if you are getting to fstab, you're already through that. |
No it's not UUID, it's DEVICE ID. Sorry for misleading. I will immediately edit my post.
|
Quote:
You're right, I think that's the other place where I should change it, see: Code:
###Don't change this comment - YaST2 identifier: Original name: linux### Ok I will give this a try, I think it will do the job. :) If I want to get rid of the Device ID setup and use Device Path (/dev/sda1 instead of the long string /dev/disk/by-id/scsi...), can I just to click the options in the fstab options of my OS' partitioner (or do it myself in fstab AND menu.lst)? Do you know if by changing it in the partitioner it will also edit menu.lst of grub? Do I have to do anything else but edit fstab and menu.lst if I swap from VolID to device path? Like running tune2fs -U clear /dev/<partition>, but that's to clear the UUID for affected partition, and I am using Device ID, but maybe I have to run something? I will give a try editing menu.lst with correct device ID first. tnx! |
Solved! :)
Using device patch in both fstab and menu.lst solved the problem. Since I am using eSATA as my 2nd disk, it seems my BIOS still defaults to internal SATA if it's connected. To make my 2nd HD to boot pasted grub I needed to unplug the internal SATA connector, even if i was choosing my eSATA HD as the primary device. But once connected alone, it booted no problem. So now I can clone my primary and keep files up dated with rsync and if I encounter a problem, I have my g4l image file (using dd) of root and my eSATA drive which can boot. :) tnx! |
All times are GMT -5. The time now is 01:32 AM. |