Need an option to generate new UUID on restfs

Post here if you found a bug or something really not expected in the program
Post Reply
gerra
Posts: 22
Joined: Sat Mar 07, 2009 3:47 pm

Need an option to generate new UUID on restfs

Post by gerra » Sat Jun 23, 2012 10:15 am

Hello, I recently did an upgrade of my Ubuntu WS to 12.04.
Before doing this, I backed up all data with fsarchiver. After the upgrade, I found out that there are some small problems, so I wanted to restore the system partition to some free space on the same harddisk. This worked well, but afterwards I could not boot the Ubuntu 12.04 anymore.
After some headaches and thinking I finally found out that the problem is: FsArchiver did restore the partition to the new position and also set its UUID. Thus, I had TWO partitions with the SAME UUID now, and GRUB did choose the wrong one for booting, where it (naturally) could not find the kernel image with the correct version.

I had to manually set another UUID for the restored partition, then everything worked well again.

So, it would be great if FsArchiver does two things on restore:
-) Check if another partition with the same UUID already exists
-) Issue an error and/or provide an option to generate a new UUID for the restored partition.

Dukers
Posts: 19
Joined: Fri Jul 09, 2010 1:31 pm

Re: Need an option to generate new UUID on restfs

Post by Dukers » Sat Jun 23, 2012 1:23 pm

I do not think this kind of check is neccessary. A command line option for change the UUID on restfs however would be a welcome feature. An option to gerenete a random UUID would be also useful.

gerra
Posts: 22
Joined: Sat Mar 07, 2009 3:47 pm

Re: Need an option to generate new UUID on restfs

Post by gerra » Sun Jun 24, 2012 7:17 am

To the contrary, I consider the check much more important!
After all, I was totally unaware of this type of problem before, and it took me quite much time to figure it out.
I think most other people will also stumble upon this the first time when they cannot boot any longer, like me.

However, if you get a warning from fsarchiver, setting a new UUID could also be done with standard commands:

uuidgen

tune2fs -U <output of uuidgen> <device>

Both of them are present on the system rescue cd.

Dukers
Posts: 19
Joined: Fri Jul 09, 2010 1:31 pm

Re: Need an option to generate new UUID on restfs

Post by Dukers » Sun Jun 24, 2012 6:45 pm

tune2fs -U random <filesystem>

will change it to a random uuid. No need for uuidgen.

There are ocasions when you want the filesystem to have the same UUID, and others when you do not. This can be solved offering an option that can on restfs:

- create the filesystem with the original uuid
- create the filesystem with a new random uuid
- create the filesystem with a user specified uuid

Which fits better for the default behaviour I think is the first one (like fsarchiver behaves now). If you make an image from your Ubuntu / filesystem and restore it *over* the original filesystem, with UUID same as before, it will be easier to reinstall GRUB. Regenerate GRUB config files and adapt fstab will not be necessary.

For other use cases I think reasonable expect a little knowledge from the user.

Post Reply