LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-23-2019, 01:14 AM   #1
eldiener
Member
 
Registered: Nov 2006
Distribution: Mepis, CentOS, OpenSuse
Posts: 106

Rep: Reputation: 17
Changing UUIDs of ext(n) partitions


I need to change the UUIDs of the /boot, /, and /home partitions for a Linux distro which I boot through the grub code in the /boot partition, and still have the distro finds its partitions. What is the best way to do this ?

My current plan is to generate new UUIDs, edit /etc/fstab and replace the relevant partition entries with the new UUIDs, reboot into gparted live, change the UUIDs of the partitions, and then reboot the distro. But I think I still need to do something with grub in the /boot partition so that this works.

As a side note I have multi-boot software that can boot any bootable partition, so the issue is not pointing my computer to the distros /boot partition, which the multi-boot software does flawlessly in order to transfer control to the boot software in that partition.

Any help would be appreciated.
 
Old 06-23-2019, 01:24 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,103

Rep: Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117
man tune2fs
 
Old 06-23-2019, 08:25 AM   #3
eldiener
Member
 
Registered: Nov 2006
Distribution: Mepis, CentOS, OpenSuse
Posts: 106

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by syg00 View Post
man tune2fs
I am aware of the command. Gparted provides a GUI interface for changing the UUID also.
 
Old 06-23-2019, 11:06 AM   #4
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,983

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
Which distro? The grub configuration files may have different locations/names depending on the distro. For *buntu based distros and probably debian as well see:

https://askubuntu.com/questions/1714...nother-machine

which goes into editing /boot/grub/grub.cfg for the new UUID.
 
Old 06-23-2019, 06:10 PM   #5
eldiener
Member
 
Registered: Nov 2006
Distribution: Mepis, CentOS, OpenSuse
Posts: 106

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by kilgoretrout View Post
Which distro? The grub configuration files may have different locations/names depending on the distro. For *buntu based distros and probably debian as well see:

https://askubuntu.com/questions/1714...nother-machine

which goes into editing /boot/grub/grub.cfg for the new UUID.
The distro is Fedora 30.
 
Old 06-23-2019, 06:31 PM   #6
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,983

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
I'm not that familiar with Fedora, but their grub2 documentation looks pretty extensive:

https://docs.fedoraproject.org/en-US...2_Boot_Loader/

The grub.cfg location depends on whether you are using a traditional bios(/boot/grub2/grub.cfg) or UEFI(/boot/efi/EFI/fedora/grub.cfg). It appears that the root partition is set in grub.cfg using UUID by default so if you change root's UUID you will also have to change it in grub.cfg. I would go over the above documentation carefully and check things against what you currently have on your Fedora installation. Not being familiar with Fedora and not having access to your box so I could go back and forth between your current grub configuration files and the Fedora documentation, any further advice I give you would be just guessing and not very helpful.
 
Old 06-24-2019, 03:25 AM   #7
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,788
Blog Entries: 1

Rep: Reputation: 2065Reputation: 2065Reputation: 2065Reputation: 2065Reputation: 2065Reputation: 2065Reputation: 2065Reputation: 2065Reputation: 2065Reputation: 2065Reputation: 2065
Once booted into Fedora, the grub2-mkconfig command will regenerate a new grub.cfg file with appropriate UUIDs whether using UEFI or otherwise. To get booted into Fedora using Grub after having updated /etc/fstab and partition UUIDs, you can edit the kernel cmdline on the fly via the E key, changing the existing root=UUID=foo to the applicable root=/dev/sdZY format, or root=LABEL=volumelabel format. You can simplify updating /etc/fstab by using unique humanly memorable volume labels, set with e2label, tune2fs or other tools, instead of humanly incomprehensible UUIDs.

None of the above is unique to Fedora, except for the command in some distros, Debian and its derivatives in particular, is grub-mkconfig rather than grub2-mkconfig. What may differ from your expectation is Fedora by default usually incorporates LVM into the partition mix, but volume labels are volume labels whether on partitions or not. Use volume labels and you should quickly be good to go.
 
1 members found this post helpful.
  


Reply

Tags
boot, uuid


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Format Ext HD into Ext3 format only (not Ext 3/4) John Glasgow Fedora 8 01-02-2012 08:56 AM
How is this possible UUIDs changing every reboot mrminty Linux - General 3 08-01-2011 04:25 AM
Can Ubuntu 7.10 be run without UUIDs? taylorkh Ubuntu 5 04-28-2008 12:23 PM
Filesystems: ext 2, ext 3, reiserfs. Which one? r3dhatter Linux - Newbie 12 07-15-2004 12:53 AM
generating uuids with uuid_gen ( libuuid ) jetley Linux - Newbie 0 05-19-2004 12:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration