LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-02-2014, 02:42 PM   #1
Amarildo
Member
 
Registered: Jun 2014
Posts: 176

Rep: Reputation: Disabled
Erase a partition without losing it's UUID?


I'm almost done making with my tutorial about how to install and re-install Debian with an encrypted LVM without losing your data, but I'm stuck at one little challenge: after doing 'dd' on /dev/sda1 (a 1 GB partition that will be used as /boot) it changes it's UUID. I'm intending to keep the UUID the same because I'm afraid some software that riquire activation (such as my Boeing 757 Pro for X-Plane) will ask for activation after the /boot/ partition changes UUID, as one of the 757's developers stated to me in a private message on X-Plane's forums.

The UUID's of the following partitions didn't change:

/dev/sda2 (the partition that holds the physical volume for the LVM)
/dev/mapper/debian-root stayed the same even after 'dd' was done into it
/dev/mapper/debian-swap
/dev/mapper/debian-home

Only '/dev/sda1' changed.

How can I erase it with 'dd' without it losing it's UUID?

Regards,
Amarildo

Last edited by Amarildo; 09-02-2014 at 02:45 PM.
 
Old 09-02-2014, 06:30 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,522

Rep: Reputation: 2039Reputation: 2039Reputation: 2039Reputation: 2039Reputation: 2039Reputation: 2039Reputation: 2039Reputation: 2039Reputation: 2039Reputation: 2039Reputation: 2039
Quote:
Originally Posted by Amarildo View Post
How can I erase it with 'dd' without it losing it's UUID?
You can't.
In a non-gpt environment, partitions don't have UUIDs, filesystems do - when you run a mkfs, a new UUID is assigned. For ext? filesystems you can enforce a specific UUID on the mkfs so it looks the same. May not be true of all filesystems.
 
Old 09-02-2014, 07:20 PM   #3
Amarildo
Member
 
Registered: Jun 2014
Posts: 176

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by syg00 View Post
You can't.
In a non-gpt environment, partitions don't have UUIDs, filesystems do - when you run a mkfs, a new UUID is assigned. For ext? filesystems you can enforce a specific UUID on the mkfs so it looks the same. May not be true of all filesystems.
But 'mkfs' was already done in the first install, then 'dd' was done before the re-install.
Does 'dd' make it necessary to redo 'mkfs'? I'm not sure. And how did the other partitions stay with their UUID's?

Regards.
 
Old 09-02-2014, 08:40 PM   #4
JeremyBoden
Senior Member
 
Registered: Nov 2011
Distribution: Debian
Posts: 1,128

Rep: Reputation: 232Reputation: 232Reputation: 232
Surely dd will destroy any file system, so you would need to recreate one.
You can specify your own UUID on a tune2fs command - ext2/3/4 filesystems only.
 
1 members found this post helpful.
Old 09-02-2014, 09:00 PM   #5
Amarildo
Member
 
Registered: Jun 2014
Posts: 176

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by JeremyBoden View Post
Surely dd will destroy any file system, so you would need to recreate one.
You can specify your own UUID on a tune2fs command - ext2/3/4 filesystems only.
Or I could make a backup of sda1 (with dd) and restore it when I want to reinstall the system?
 
Old 09-02-2014, 10:03 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,522

Rep: Reputation: 2039Reputation: 2039Reputation: 2039Reputation: 2039Reputation: 2039Reputation: 2039Reputation: 2039Reputation: 2039Reputation: 2039Reputation: 2039Reputation: 2039
We don't know what is is you are (mis-)interpreting, so can't sensibly comment futher IMHO.
 
Old 09-02-2014, 10:49 PM   #7
replica9000
Senior Member
 
Registered: Jul 2006
Location: USA
Distribution: Debian, FreeBSD, Android
Posts: 1,050
Blog Entries: 2

Rep: Reputation: 224Reputation: 224Reputation: 224
If you are taking an existing install, backing it up with dd, then restoring that install with dd into the encrypted LVM, the UUID should remain the same for the filesystem. The UUID of the partition will change, since it will no longer show the UUID of the filesystem, but the encrypted container.
 
Old 09-03-2014, 09:27 AM   #8
verndog
Member
 
Registered: Oct 2007
Posts: 120

Rep: Reputation: 18
Simply reformat with "U" option: mkfs.xxx -U xxx or tune2fs -U xxx
 
1 members found this post helpful.
  


Reply


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
[SOLVED] How do I change the UUID of a partition? widget Debian 9 08-30-2012 02:12 AM
[SOLVED] Getting the UUID of a swap partition eldiener Linux - Software 11 07-30-2012 05:38 PM
Which distros use UUID partition addressing Nick_C Linux - Virtualization and Cloud 4 03-08-2012 06:35 PM
how is partition uuid generated? robertchen Linux - Software 3 02-10-2012 05:02 PM
Swap partition UUID changed. What do I do? searcher1 Linux - Newbie 12 06-05-2010 10:15 AM


All times are GMT -5. The time now is 12:46 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration