Find the answer to your Linux question:
Results 1 to 8 of 8
Hello all, I'm new here and have been messing around in Linux for a little over a year now and I am now working on some more advanced (for me) ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Mar 2012
    Posts
    5

    Backup root partition, and boot from backup root


    Hello all, I'm new here and have been messing around in Linux for a little over a year now and I am now working on some more advanced (for me) system coursework. Yes, this is homework for a security system admin class, but I have worked on this individual problem for about 10 hours and haven't moved forward on it.

    I am running Linux Mint in a virtual machine, and I needed to add a disk to my system and set up a partition or logical volume on the new disk as a backup root partition. I have added a 4GB "disk" and I'm assuming now I need to format it with GUID partitioning table, since it will be used for Linux. Once that is done, I need to have it set as a backup root partition with EXT4. I assume that next I need to dd /boot to this partition? I am a little lost on what to do there.

    On to the next part of the problem, I need to make sure I can boot from the backup root (created above) and that the system will run normally when so booted. I'm thinking that this has to do with GRUB but I'm not completely sure, I need to make sure that the system boots from this particular partition, but still has access to all of the other parts of the OS so it will run like nothing ever happened. This is where I'm more than a little lost.

    I know that I need root access, but I'm somewhat worried about moving files around and not being able to boot the virtual machine back up if I do mess something up, so a little guidance would be very helpful.

  2. #2
    Just Joined!
    Join Date
    Mar 2012
    Posts
    5
    Well it seems that dd'ing into a 4GB disk wouldn't work because it wanted to copy over everything, including empty space. I got that done, and sdb is an identical copy of sda. Question now is how do I get it to boot into sdb's version of root.

    I "unplugged" the original HDD and booted into a liveCD in order to mount sdb and hopefully get it to work, but I'm missing on how to get it to recognize itself as the new boot disk. When in the BIOS after ejecting the CD and rebooting, it says it's waiting on the IDE drive and it just sits there looking for something. I'm not sure where to go from here.

  3. #3
    Just Joined!
    Join Date
    Mar 2012
    Posts
    5
    Well guys, thanks for all the views and no replies. I didn't realize this was such a difficult problem that I had.

  4. #4
    Linux Engineer
    Join Date
    Apr 2012
    Location
    Virginia, USA
    Posts
    774
    Quote Originally Posted by jeiroq View Post
    Hello all, I'm new here and have been messing around in Linux for a little over a year now and I am now working on some more advanced (for me) system coursework. Yes, this is homework for a security system admin class, but I have worked on this individual problem for about 10 hours and haven't moved forward on it.

    I am running Linux Mint in a virtual machine, and I needed to add a disk to my system and set up a partition or logical volume on the new disk as a backup root partition. I have added a 4GB "disk" and I'm assuming now I need to format it with GUID partitioning table, since it will be used for Linux. Once that is done, I need to have it set as a backup root partition with EXT4. I assume that next I need to dd /boot to this partition? I am a little lost on what to do there.

    On to the next part of the problem, I need to make sure I can boot from the backup root (created above) and that the system will run normally when so booted. I'm thinking that this has to do with GRUB but I'm not completely sure, I need to make sure that the system boots from this particular partition, but still has access to all of the other parts of the OS so it will run like nothing ever happened. This is where I'm more than a little lost.

    I know that I need root access, but I'm somewhat worried about moving files around and not being able to boot the virtual machine back up if I do mess something up, so a little guidance would be very helpful.
    While linux mint is a fine choice for desktop operation, it's likely a poor choice for your class's assignment. Pick a little-bit older distro, such as Debian 6 or CentOS. You will then have at your disposal Grub 1, instead of Grub 2. I know nothing of the workings of Grub 2, and neither does anyone else except for the people that wrote it (okay, I'm exaggerating a little bit, but you get my drift). Install the new distro, with preferably a separate /boot partition. You will want to use regular MBR style partitioning, don't make things more complicated than they have to be.

    Now that you have a workable distro, add the second disk, and copy over the / partition using whatever utility you have at your disposal. You may be able to use dd with the drive mounted, IDK, never tried it.

    Okay, so now that you have a 1-1 copy, you should be ready to test it out. Reboot the system, and when you get to the grub loading screen, press 'e' to edit.
    Edit boot stanzas in GRUB | TechRepublic

    Now, doing this with LVM will add more difficulty, and if it's not required for this project, I would skip that all together. Just use regular partitions.
    Here's what you want to edit:

    root (hd0,0)
    kernel /vmlinuz ro root=/dev/hdc5 vga=788 noapic acpi=ht
    initrd /initrd.img

    The first part is where it tells the grub loader to find all the boot stuff. I'm hazy on the details how that all works, but essentially it's your /boot. /boot may be on /, or it may be on it's own partition. If it's on it's own partition (this is generally preferable in production environments), then you can leave that part as it is. If it's on the same partition as the original /, you will want to change that to whatever your new / partition is. So, if you added a single partition on a new disk, it's likely (hd1,0)

    The second bolded part points to your / directory. So, you will likely change that to something like /dev/sdb1

    And there you have it. Press whatever the screen tells you to boot, and you should be booting off the new partition.

  5. #5
    Just Joined!
    Join Date
    Mar 2012
    Posts
    5
    Thank you for your help, my internet at home is too slow to get an image and get it installed in a virtual environment with this being due at midnight. I was thinking that I had Grub2 because it seems a little more difficult to configure. When I played with Linux before (probably 5 years ago, I'm only 25, haha) it seemed to be quite a bit easier to edit because I was multibooting then.

  6. #6
    Linux Engineer
    Join Date
    Apr 2012
    Location
    Virginia, USA
    Posts
    774
    I guess you'll have to look up the steps for Grub 2. I'm sure there's something similar that can be done. Grub 2 is new new stuff, so even the most recent stable releases of the distros I suggested don't use it.

    But, your statement poses a question to me: No b/w to download an image, how do you suppose you're going to submit the assignment then?

  7. #7
    Just Joined!
    Join Date
    Mar 2012
    Posts
    5
    My internet is just really slow, I have to take screen shots and turn that stuff in with some written explanations. I drove to campus in order to download a new image and hopefully get it installed and perform the tasks on it within the next 2 hours. The assignment is at max 1-2 MB and could take up to 5-10 minutes to upload. On campus I have better b/w. I'm going to try out CentOS6, it doesn't have Grub 2 right? I looked online and it's showing that it has Grub .97, don't know if that's correct or not.

    Edit: I do have to say that I like the look of CentOS, it has a nice feel to it as well and seems a logical layout, as in it has been logically thought about and laid out. I might have found a new favorite!
    Last edited by jeiroq; 10-22-2012 at 03:03 AM.

  8. #8
    Linux Engineer
    Join Date
    Apr 2012
    Location
    Virginia, USA
    Posts
    774
    Well, hopefully you got it all sorted out. Yeah, that is the correct version of grub on CentOS.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •