LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
LinkBack Search this Thread
Old 08-01-2013, 02:12 PM   #1
cowmoo32
Member
 
Registered: May 2007
Posts: 40

Rep: Reputation: 0
Unable to change UUID - Bad magic number in super-block


I used clonezilla to clone an entire drive. My end goal is to run updates on this drive, boot from it, and migrate the updates over to the "original" drive. To keep the computer from getting confused when I boot with two identical drives, I need to change the UUID but I'm running into trouble.

Code:
# uuid
dc0e45c0-fada-11e2-8e97-2fa4191f2c28
# tune2fs /dev/sda2 -U 'dc0e45c0-fada-11e2-8e97-2fa4191f2c28'
tune2fs 1.41.12 (17-May-2010)
tune2fs: Bad magic number in super-block while trying to open /dev/sda2
Couldn't find valid filesystem superblock.
This is an LVM member if that makes any difference.
Code:
# fdisk -l

Disk /dev/sda: 250.0 GB, 250000000000 bytes
255 heads, 63 sectors/track, 30394 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00097d75

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          64      512000   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              64       30395   243627008   8e  Linux LVM
 
Old 08-01-2013, 02:40 PM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 1,819

Rep: Reputation: Disabled
You cannot use tune2fs (or any other file system tool) on an LVM Physical Volume, simply because the file system isn't written directly to that volume. The file system is written to a Logical Volume, which exists inside a Volume Group, which consists of on one or more Physical Volumes.

Find the true identity of the device (the Logical Volume) the file system is on, and run tune2fs on that device instead.
 
Old 08-01-2013, 02:40 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 11,532

Rep: Reputation: 674Reputation: 674Reputation: 674Reputation: 674Reputation: 674Reputation: 674
It does, an LVM partition is a container for logical volumes which are the actual filesystems. What linux distribution/version are you running?

You can change the UUIDs with the pvchange command but you also need to change the volume group name in order to mount the clone on the same system. You will need to boot from a rescue disk in order to rename your / logical volume.
 
Old 08-02-2013, 09:18 AM   #4
cowmoo32
Member
 
Registered: May 2007
Posts: 40

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Ser Olmy View Post
You cannot use tune2fs (or any other file system tool) on an LVM Physical Volume, simply because the file system isn't written directly to that volume. The file system is written to a Logical Volume, which exists inside a Volume Group, which consists of on one or more Physical Volumes.

Find the true identity of the device (the Logical Volume) the file system is on, and run tune2fs on that device instead.
/dev/sda1 is my boot partition and /dev/sda2 is the LVM. Are you saying the 'true' UUID is on sda1?

Quote:
Originally Posted by michaelk View Post
It does, an LVM partition is a container for logical volumes which are the actual filesystems. What linux distribution/version are you running?

You can change the UUIDs with the pvchange command but you also need to change the volume group name in order to mount the clone on the same system. You will need to boot from a rescue disk in order to rename your / logical volume.
I'm on RHEL 6. I was afraid of needing a rescue disk to change the volume group name and was hoping there was a way of avoiding that, oh well.
 
Old 08-02-2013, 09:48 AM   #5
cowmoo32
Member
 
Registered: May 2007
Posts: 40

Original Poster
Rep: Reputation: 0
...
Code:
# blkid
/dev/mapper/vg_hallen4brxrc1-lv_root: UUID="d8e96ad4-45e8-44ce-b11d-acb71abf90c6" TYPE="ext4" 
/dev/sda2: UUID="7CBVuf-OmlK-2OnU-UVM0-O7nA-s8I3-zvOFKg" TYPE="LVM2_member" 
/dev/sda1: UUID="899895d5-6fb4-4c87-a761-65345e88174d" TYPE="ext4" 
/dev/mapper/vg_hallen4brxrc1-lv_swap: UUID="7450754c-e2a2-4516-b989-bfbb5e985de7" TYPE="swap" 
/dev/mapper/vg_hallen4brxrc1-lv_home: UUID="7aa466a7-ed56-4697-a228-086b2749f390" TYPE="ext4" 
# blkid
/dev/mapper/vg_hallen4brxrc1-lv_root: UUID="d8e96ad4-45e8-44ce-b11d-acb71abf90c6" TYPE="ext4" 
/dev/sda2: UUID="7CBVuf-OmlK-2OnU-UVM0-O7nA-s8I3-zvOFKg" TYPE="LVM2_member" 
/dev/sda1: UUID="899895d5-6fb4-4c87-a761-65345e88174d" TYPE="ext4" 
/dev/mapper/vg_hallen4brxrc1-lv_swap: UUID="7450754c-e2a2-4516-b989-bfbb5e985de7" TYPE="swap" 
/dev/mapper/vg_hallen4brxrc1-lv_home: UUID="7aa466a7-ed56-4697-a228-086b2749f390" TYPE="ext4" 
# pvchange -u /dev/sda2
  Volume group containing /dev/sda2 has active logical volumes
  0 physical volumes changed / 1 physical volume not changed
# pvchange -u /dev/sda1
  Failed to read physical volume /dev/sda1
  0 physical volumes changed / 0 physical volumes not changed
# pvchange -u /dev/mapper/vg_hallen4brxrc1-lv_home
  Failed to read physical volume /dev/mapper/vg_hallen4brxrc1-lv_home
  0 physical volumes changed / 0 physical volumes not changed
 
Old 08-02-2013, 11:09 AM   #6
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 1,819

Rep: Reputation: Disabled
Quote:
Originally Posted by cowmoo32 View Post
...
Code:
# blkid
/dev/mapper/vg_hallen4brxrc1-lv_root: UUID="d8e96ad4-45e8-44ce-b11d-acb71abf90c6" TYPE="ext4" 
/dev/sda2: UUID="7CBVuf-OmlK-2OnU-UVM0-O7nA-s8I3-zvOFKg" TYPE="LVM2_member" 
/dev/sda1: UUID="899895d5-6fb4-4c87-a761-65345e88174d" TYPE="ext4" 
/dev/mapper/vg_hallen4brxrc1-lv_swap: UUID="7450754c-e2a2-4516-b989-bfbb5e985de7" TYPE="swap" 
/dev/mapper/vg_hallen4brxrc1-lv_home: UUID="7aa466a7-ed56-4697-a228-086b2749f390" TYPE="ext4"
Clearly, your root device is /dev/mapper/vg_hallen4brxrc1-lv_root. That's the device with the file system which UUID you wish to change.

LVM Physical Volumes also have UUIDs, but they are not related to the file system at all. They are only used by the LVM subsystem, and have nothing to do with the UUID you can pass to the mount command or put in /etc/fstab as a device reference.
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Always getting bad magic number in super-block Mountain Linux - Hardware 1 07-01-2010 12:05 PM
bad magic number to open super block Ritho Linux - Newbie 1 03-06-2008 08:02 AM
Bad magic number in super-block Cadmium Linux - Newbie 2 10-03-2007 01:50 AM
e2fsck: Bad magic number in super-block jamesdin Debian 3 04-25-2005 05:14 PM
Bad magic number in super-block kubokubik Linux - Newbie 4 01-26-2005 10:52 AM


All times are GMT -5. The time now is 07:41 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration