0

The initial problem was this: I wanted to test the installer I was creating for my app, but of course every time I run the installer it modifies the system, and I needed a way to reset the system to a clean state for the next test.

My initial solution was this: I created a small partition on my hard disk (/dev/sdb3) and installed Ubuntu 14.04 onto it. I then created a second small partition (/dev/sdb4) and did a "dd" to copy sdb3 to sdb4. My idea was to then test my installer on sdb4, and then reset sdb4 by doing another dd from sdb3 before running the next test.

I set up grub to multi-boot (so I can pick my original Ubuntu partition, or the "clean" partition sdb3, or the test partition sdb4).

The problem I'm now running into is this: when I run grub, it gives me all the correct options, but if I ask to boot onto sdb4, it's about 50/50 whether I get sdb4 or sdb3. I'm guessing that grub is not using the partition name, but rather some kind of UID in the Ubuntu install (so sdb3 and sdb4 look identical)?

As a side note, whether I boot to sdb3 or sdb4, when I run gparted, both sdb3 and sdb4 are shown as being locked.

Is there something I need to do to sdb4, after dd'ing it from sdb3, so that it's clearly different from sdb3?

Thanks, Chris

  • Well, you are right about duplicate UUIDs being bad, so edit the grub.cfg file and use /dev/sdb4 instead of the uuid. – ubfan1 Nov 13 '14 at 17:18
0

Yes, duplicate uuids will confuse the system. This is one reason why you should not be playing around with dd like that. Another reason is that dd wastes time copying free space. If you want to backup and restore the system, use tar instead. If you insist on using dd, then don't copy to a second partition -- copy to a file instead.

  • Ok, I guess I can feel partially good that I figured out my mistake (grin). I deleted the second partition (sdb4) and did a "tar -cpzf" of the first partition (sdb3) from my development partition. I tested my installer and had some issues, now I want to reset sdb3 to its original "clean" state. Problem is, just running 'tar' doesn't delete any files my installer created - it only overwrites any changed files (right?). How can I restore my partition to its EXACT state before I tested my installer? – Betty Crokker Nov 13 '14 at 20:21
  • @BettyCrokker, delete all of the existing files first either with rm -fr or it would probably be faster to unmount and reformat the partition. – psusi Nov 13 '14 at 20:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.