Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I've read quite a bit on the Internet before deciding to post the problem here and I am sure the answer must be out there already, I just didn't find it...
I have a PC with SUSE 10.2 (SLES, if it makes a difference) and I have these two partitions: /dev/sda1 mounted in / and /dev/sda2 mounted in /passive. This /passive is empty. I need to be able to make /passive bea copy of / and boot from it.
Let me explain. I make a big fat tgz of / excluding some directories such as /proc, /sys, /tmp, /var and of course /passive. I copy the tar to /passive and untar it there (or I can even store it on a different machine and then download it to /passive when I want). I create the directories I excluded above manually (and leave them empty). Then I go to /boot/grub/menu.lst and I add an entry which looks just like the first one, I just update (hd0,0) to be hd(0,1), I update root=... to go to sda2 and I update default 0 to be default 1. In /passive/fstab, I swap the mounting locations of sda1 to be /passive and sda2 to be /. I reboot the machine and it starts up just fine booting off of the formerly passive (sda2) partition. Now I have sda1 mounted in /passive.
However, I still used the menu.lst file in sda1 (which is now passive). It turns out I am using more than just this from sda1 but I just cannot figure out what else. The system always boots after I pull such a stunt.
Then I want to do a restore into sda1 (now passive). I begin with a "rm -rf *" in what is not /passive. Then I download a tgz into that directory and untar it. To eliminate issues related to host-specific configuration data (such as host name, ip addresses, mac addresses, etc, I use a tgz created off this same machine). I do the same thing to the /passive/etc/fstab (mount sda1 into / and sda2 into /passive) and then go to the menu.lst file in /passive/boot/grub and make sure I have the entires for booting sda1 and 2, and make sure the default is 0 (sda1). For all i care, it seems I can erase menu.lst from sda2 since it is never used. Until now I just did to sda2 what I had done to sda2 before. After a reset the machine doesn't boot anymore.
I am afraid I am destroying something with my rm -rf I am not restoring when untaring my tarball. The fact that menu.lst is always used off sda1 makes me think I am missing something that would allow me to treat these two partitions symmetrically. I think I don;t understand very well what grub does from the very beginning, especially after stage1 is loaded from the MBR. I read about stage1.5 and stage2, but it is not clear to me if those files are addressed as a fixed (hardcoded) block offset location on the disk (saved in MBR, for example, at install-time) and I am screwing this up by deleting and re-copying the files (they are the same location as referred by a file system path but not same physical disk location.
After this long novel, I think my conclusion is that there's something going on during the early stages of grub and system's coming up to life that I don't really understand, nor did I find the info about (lots of pages go almost there, but not quite there...).
I hope this makes some sense and someone can help me.
You're right, it may not be the brightest idea, but it is a constraint imposed to me so I don't really have a choice, I need to make it work ...somehow That is using the tgz file as storage and not creating a bit-image of the partition (for that reason partimage may not work if it does what I suspect it does).
Thanks for the links to the tutorial and the troubleshooter. I'll read all that stuff hoping I'd find more details than I already found (which seem not to be enough). I'll also look at partimage, if not to use it now, at least for my enlightenment
Oh, one more thing: I know that info is put in the MBR, but I don't know "where" is expressed in block offset (suspect yes)or file system path (guess not) which makes the file immovable from the physical location where it was installed on the disk (unless that pointer info is also updated). Well, off to reading, looks like there's plenty for me to learn.
Oh, one more thing: I know that info is put in the MBR, but I don't know "where" is expressed in block offset (suspect yes)or file system path (guess not) which makes the file immovable from the physical location where it was installed on the disk (unless that pointer info is also updated). Well, off to reading, looks like there's plenty for me to learn.
Thanks for your reply,
Radu
What goes in the MBR is a pointer to the partition containing /boot (This being where the kernel and the GRUB files are). If you install GRUB using "root (hd0,1)" it will always look for the 2nd partition on the first hard disk--no matter where that is on the physical disks. But you can do something that changes the bios order of the drives (eg swapping master and slave on IDE), and then GRUB will be lost.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.