LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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: 21,103

Rep: Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117
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
Location: London, UK
Distribution: Debian
Posts: 1,947

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
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: 21,103

Rep: Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117
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
Distribution: Debian Unstable
Posts: 1,106
Blog Entries: 2

Rep: Reputation: 258Reputation: 258Reputation: 258
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: 277

Rep: Reputation: 66
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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:02 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