OG, glad you got where you wanted to be. Sometimes the best solution is the quickest one to success!
Thanks for the compliment. Most of this topic I learned about the very hard way - weekends of re-arranging, partitioning, moving drives about, losing data, etc. Now I primarily use btrfs which eliminates a lot of the work.
I can see where with caddy using the device name would be the better choice.
On a single disk system with very basic and stable partitioning, there's no or little advantage to UUID labeling. However, in a multidisk environment or on a PC where you regularly add and subtract disks or even partitions, UUIDs can be major work-savers. Moving a disk from sda to sdf and then adding three partitions to it ahead of a bootable partition - making it partition 6 instead of 3 for example, would change /dev/sda3 to /dev/sdf6. In a testing environment like mine (ok, playground might be a better word ) If this partition is being accessed from 3 or 4 other installs and 2 different GRUB installs - they all have to be edited. If you're using UUID - then none need to be edited. Obviously, UUIDs are much better in a case like mine.
The only time a UUID changes is when you reformat. In some cases - swap partitions being one of them - this causes problems. For instance, 3 or 4 different installs all using a single swap. In this case, if you needed to recreate your swap partition, (moving it to a different disk or changing its size), copy the current UUID, use the -U switch with mkswap and use the same UUID (example below). Then all your installs need no editing - they will all use the new swap without any other changes. Neat huh?
Saving your swap UUID (terminal commands in bold):
Before deleting the old swap, get the UUID:
SWAPUUID=`sudo blkid -c /dev/null -o list |grep swap | awk '{ print $4 }'`
The above command is chock full of neat little bash tricks. The blkid options put the UUID info in columns and makes sure it's current. The grep command eliminates all the UUIDs except the swap partition. The awk command leaves only the UUID. And finally, the SWAPUUID=` ` puts the UUID neatly into a variable for later use. Note that bash variables of this sort would not survive closing the konsole session.
Next you would turn off the swap;
sudo swappoff -a
Now delete the current swap partition using your tool of choice (fdisk for me) and create a new one. Then make the new swap partition using the previous UUID
sudo mkswap -U $SWAPUUID /dev/sdXX
and that's it! No editing of several fstabs or having all your install stall during boot looking for a swap partition.
Originally posted by Teunis
I can see where with caddy using the device name would be the better choice.
On a single disk system with very basic and stable partitioning, there's no or little advantage to UUID labeling. However, in a multidisk environment or on a PC where you regularly add and subtract disks or even partitions, UUIDs can be major work-savers. Moving a disk from sda to sdf and then adding three partitions to it ahead of a bootable partition - making it partition 6 instead of 3 for example, would change /dev/sda3 to /dev/sdf6. In a testing environment like mine (ok, playground might be a better word ) If this partition is being accessed from 3 or 4 other installs and 2 different GRUB installs - they all have to be edited. If you're using UUID - then none need to be edited. Obviously, UUIDs are much better in a case like mine.
The only time a UUID changes is when you reformat. In some cases - swap partitions being one of them - this causes problems. For instance, 3 or 4 different installs all using a single swap. In this case, if you needed to recreate your swap partition, (moving it to a different disk or changing its size), copy the current UUID, use the -U switch with mkswap and use the same UUID (example below). Then all your installs need no editing - they will all use the new swap without any other changes. Neat huh?
Saving your swap UUID (terminal commands in bold):
Before deleting the old swap, get the UUID:
SWAPUUID=`sudo blkid -c /dev/null -o list |grep swap | awk '{ print $4 }'`
The above command is chock full of neat little bash tricks. The blkid options put the UUID info in columns and makes sure it's current. The grep command eliminates all the UUIDs except the swap partition. The awk command leaves only the UUID. And finally, the SWAPUUID=` ` puts the UUID neatly into a variable for later use. Note that bash variables of this sort would not survive closing the konsole session.
Next you would turn off the swap;
sudo swappoff -a
Now delete the current swap partition using your tool of choice (fdisk for me) and create a new one. Then make the new swap partition using the previous UUID
sudo mkswap -U $SWAPUUID /dev/sdXX
and that's it! No editing of several fstabs or having all your install stall during boot looking for a swap partition.
Comment