FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 12-04-2008, 08:15 PM
lee
 
Default software raid 1: how to remove a UUID from a device?

Hi,

after switching from i386 to x86_64, my software RAID-1 partitions
were not discovered automatically as they should have been. It seems
that the physical devices (/dev/sda and /dev/sdb) have UUIDs stored
from when I first tried to create the array, and that may have
confused the automatic detection.

My first try (a couple years ago, when the disks were new) had been to
create a RAID-1 from the two disks and to partition that array later
as needed. But that didn't work, so I created partitions on the disks
and then created RAID-1 arrays from these partitions. Now it looks like this:


Device Boot Start End Blocks Id System
/dev/sda1 1 9119 73248336 fd Linux raid autodetect
/dev/sda2 9120 29788 166023742+ fd Linux raid autodetect
/dev/sda3 29789 36483 53777587+ fd Linux raid autodetect

Device Boot Start End Blocks Id System
/dev/sdb1 1 9119 73248336 fd Linux raid autodetect
/dev/sdb2 9120 29788 166023742+ fd Linux raid autodetect
/dev/sdb3 29789 36483 53777587+ fd Linux raid autodetect


cat:/etc/exim4# mdadm --examine --scan /dev/sda1
ARRAY /dev/md0 level=raid1 num-devices=2 UUID=ca34e190:39db09f0:390edcc4:35d74b5f
cat:/etc/exim4# mdadm --examine --scan /dev/sdb1
ARRAY /dev/md0 level=raid1 num-devices=2 UUID=ca34e190:39db09f0:390edcc4:35d74b5f

cat:/etc/exim4# mdadm --examine --scan /dev/sda2
ARRAY /dev/md1 level=raid1 num-devices=2 UUID=9f9a753b:eb70a81c:5ff8d522:9ec3586b
cat:/etc/exim4# mdadm --examine --scan /dev/sdb2
ARRAY /dev/md1 level=raid1 num-devices=2 UUID=9f9a753b:eb70a81c:5ff8d522:9ec3586b

cat:/etc/exim4# mdadm --examine --scan /dev/sda3
ARRAY /dev/md2 level=raid1 num-devices=2 UUID=ae296907:7c3dc6ef:763a7645:40ee5e12
cat:/etc/exim4# mdadm --examine --scan /dev/sdb3
ARRAY /dev/md2 level=raid1 num-devices=2 UUID=ae296907:7c3dc6ef:763a7645:40ee5e12


cat:/etc/exim4# mdadm --examine --scan /dev/sda
ARRAY /dev/md0 level=raid1 num-devices=2 UUID=c5460893:6fe1b92f:8d76d626:2a523555
cat:/etc/exim4# mdadm --examine --scan /dev/sdb
ARRAY /dev/md0 level=raid1 num-devices=2 UUID=c5460893:6fe1b92f:8d76d626:2a523555


Note that the physical devices /dev/sda and /dev/sdb have UUIDs
stored. How do I remove these UUIDs?


The automatic detection created these entries in
/etc/mdadm/mdadm.conf (I commented them out later):


# definitions of existing MD arrays
#ARRAY /dev/md0 level=raid1 num-devices=2 UUID=c5460893:6fe1b92f:8d76d626:2a523555
#ARRAY /dev/md0 level=raid1 num-devices=2 UUID=ca34e190:39db09f0:390edcc4:35d74b5f
#ARRAY /dev/md1 level=raid1 num-devices=2 UUID=9f9a753b:eb70a81c:5ff8d522:9ec3586b
#ARRAY /dev/md2 level=raid1 num-devices=2 UUID=ae296907:7c3dc6ef:763a7645:40ee5e12


This left me with a /dev/md0 across both disks, fdisk -l showing
non-existent devices /dev/md0p1, /dev/md0p2 etc., the data
inaccessable, a resync started automatically and /dev/md1 and /dev/md2
broken.

After the resync was done, I stopped all md devices and added the
partitions to the md devices manually. Fortunately, I didn't lose any
data ... Now I have /dev/md0, /dev/md1 and /dev/md2 as they were
before. The entries in /etc/mdadm/mdadm.conf probably should look like this:


ARRAY /dev/md0 level=raid1 num-devices=2 metadata=00.90 UUID=ca34e190:39db09f0:390edcc4:35d74b5f
ARRAY /dev/md1 level=raid1 num-devices=2 metadata=00.90 UUID=9f9a753b:eb70a81c:5ff8d522:9ec3586b
ARRAY /dev/md2 level=raid1 num-devices=2 metadata=00.90 UUID=ae296907:7c3dc6ef:763a7645:40ee5e12


Does this look correct?

How do I remove the UUIDs from /dev/sda and /dev/sdb to prevent
the automatic detection from being confused again?


--
"Don't let them, daddy. Don't let the stars run down."
http://adin.dyndns.org/adin/TheLastQ.htm


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 12-04-2008, 09:11 PM
"Boyd Stephen Smith Jr."
 
Default software raid 1: how to remove a UUID from a device?

On Thursday 2008 December 04 15:15, lee wrote:
> How do I remove the UUIDs from /dev/sda and /dev/sdb to prevent
> the automatic detection from being confused again?

Check out the --zero-superblock mode for mdadm. It is documented in 'man 8
mdadm'.
--
Boyd Stephen Smith Jr. * * * * * * * * * * ,= ,-_-. =.
bss03@volumehost.net * * * * * * * * * * *((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy * * * * * `-'(. .)`-'
http://iguanasuicide.org/ * * * * * * * * * * *\_/ * *
 
Old 12-05-2008, 12:10 AM
lee
 
Default software raid 1: how to remove a UUID from a device?

> On Thursday 2008 December 04 15:15, lee wrote:
> > How do I remove the UUIDs from /dev/sda and /dev/sdb to prevent
> > the automatic detection from being confused again?

> Check out the --zero-superblock mode for mdadm. It is documented in 'man 8
> mdadm'.

cat:/home/lee# mdadm --zero-superblock /dev/sdb
mdadm: Couldn't open /dev/sdb for write - not zeroing


It's the same for sda. Do I need to stop all md devices involving
these disks to remove the UUID? If so, how do you do it when it's not
possible to stop them while the system is running (other than booting
from CD or the like)?


--
"Don't let them, daddy. Don't let the stars run down."
http://adin.dyndns.org/adin/TheLastQ.htm


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 12-05-2008, 12:40 AM
Alex Samad
 
Default software raid 1: how to remove a UUID from a device?

On Thu, Dec 04, 2008 at 07:10:44PM -0600, lee wrote:
> > On Thursday 2008 December 04 15:15, lee wrote:
> > > How do I remove the UUIDs from /dev/sda and /dev/sdb to prevent
> > > the automatic detection from being confused again?
>
> > Check out the --zero-superblock mode for mdadm. It is documented in 'man 8
> > mdadm'.
>
> cat:/home/lee# mdadm --zero-superblock /dev/sdb
> mdadm: Couldn't open /dev/sdb for write - not zeroing
>
>
> It's the same for sda. Do I need to stop all md devices involving
> these disks to remove the UUID? If so, how do you do it when it's not
> possible to stop them while the system is running (other than booting
> from CD or the like)?

whilst booting add init=/bin/bash to the kernel options, or boot up
knoppix or something like it

>
>
> --
> "Don't let them, daddy. Don't let the stars run down."
> http://adin.dyndns.org/adin/TheLastQ.htm
>
>
> --
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
>
>

--
"I'll be glad to talk about ranching, but I haven't seen the movie. I've heard about it. I hope you go --you know-- I hope you go back to the ranch and the farm is what I'm about to say."

- George W. Bush
01/23/2006
Manhattan, KS
Explaining that he hasn't seen Brokeback Mountain yet
 
Old 12-05-2008, 08:14 AM
Neil
 
Default software raid 1: how to remove a UUID from a device?

On Thu, Dec 4, 2008 at 10:15 PM, lee <lee@yun.yagibdah.de> wrote:
> Hi,
>
> after switching from i386 to x86_64, my software RAID-1 partitions
> were not discovered automatically as they should have been. It seems
> that the physical devices (/dev/sda and /dev/sdb) have UUIDs stored
> from when I first tried to create the array, and that may have
> confused the automatic detection.
>
> My first try (a couple years ago, when the disks were new) had been to
> create a RAID-1 from the two disks and to partition that array later
> as needed. But that didn't work, so I created partitions on the disks
> and then created RAID-1 arrays from these partitions. Now it looks like this:
>

<snip>

> Note that the physical devices /dev/sda and /dev/sdb have UUIDs
> stored. How do I remove these UUIDs?
>

You can't. The UUID is calculated out of the properties of the disk
(dunno wich exactly). It's like trying to remove the MD5 checsum of
something: you can't.

However: your problem will be solvable and the guys who know how to do
this are already busy.

Neil

--
While working towards the future one should be ensuring that there is
a future to work to.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 12-05-2008, 08:36 AM
Alex Samad
 
Default software raid 1: how to remove a UUID from a device?

On Fri, Dec 05, 2008 at 10:14:42AM +0100, Neil wrote:
> On Thu, Dec 4, 2008 at 10:15 PM, lee <lee@yun.yagibdah.de> wrote:
> > Hi,
> >
> > after switching from i386 to x86_64, my software RAID-1 partitions
> > were not discovered automatically as they should have been. It seems
> > that the physical devices (/dev/sda and /dev/sdb) have UUIDs stored
> > from when I first tried to create the array, and that may have
> > confused the automatic detection.
> >
> > My first try (a couple years ago, when the disks were new) had been to
> > create a RAID-1 from the two disks and to partition that array later
> > as needed. But that didn't work, so I created partitions on the disks
> > and then created RAID-1 arrays from these partitions. Now it looks like this:
> >
>
> <snip>
>
> > Note that the physical devices /dev/sda and /dev/sdb have UUIDs
> > stored. How do I remove these UUIDs?
> >
>
> You can't. The UUID is calculated out of the properties of the disk
> (dunno wich exactly). It's like trying to remove the MD5 checsum of
> something: you can't.

??

I accidentally did a mdadm /dev/md0 /dev/sdc (notice no partition
number), which made mdadm write a superblock, I had to zero the super
block to stop mdadm complaining about sdc, because I had partitions on
there which where being used in md devices. Why do you think you can't
zero out the md-super block for /dev/sdc ?

>
> However: your problem will be solvable and the guys who know how to do
> this are already busy.
>
> Neil
>
> --
> While working towards the future one should be ensuring that there is
> a future to work to.
>
>
> --
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
>
>

--
"After the bombing, most Iraqis saw what the perpetuators of this attack were trying to do."

- George W. Bush
03/13/2006
Washington, DC
Regarding the bombing of the Golden Mosque of Samarra in Iraq
 
Old 12-05-2008, 05:52 PM
lee
 
Default software raid 1: how to remove a UUID from a device?

On Fri, Dec 05, 2008 at 12:40:21PM +1100, Alex Samad wrote:
> On Thu, Dec 04, 2008 at 07:10:44PM -0600, lee wrote:
> > > On Thursday 2008 December 04 15:15, lee wrote:
> > > > How do I remove the UUIDs from /dev/sda and /dev/sdb to prevent
> > > > the automatic detection from being confused again?
> >
> > > Check out the --zero-superblock mode for mdadm. It is documented in 'man 8
> > > mdadm'.
> >
> > cat:/home/lee# mdadm --zero-superblock /dev/sdb
> > mdadm: Couldn't open /dev/sdb for write - not zeroing
> >
> >
> > It's the same for sda. Do I need to stop all md devices involving
> > these disks to remove the UUID? If so, how do you do it when it's not
> > possible to stop them while the system is running (other than booting
> > from CD or the like)?
>
> whilst booting add init=/bin/bash to the kernel options, or boot up
> knoppix or something like it

Oh. Does bash run with only the root partition mounted?


--
"Don't let them, daddy. Don't let the stars run down."
http://adin.dyndns.org/adin/TheLastQ.htm


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 12-05-2008, 05:55 PM
Alex Samad
 
Default software raid 1: how to remove a UUID from a device?

On Fri, Dec 05, 2008 at 12:52:52PM -0600, lee wrote:
> On Fri, Dec 05, 2008 at 12:40:21PM +1100, Alex Samad wrote:
> > On Thu, Dec 04, 2008 at 07:10:44PM -0600, lee wrote:
> > > > On Thursday 2008 December 04 15:15, lee wrote:
> > > > > How do I remove the UUIDs from /dev/sda and /dev/sdb to prevent
> > > > > the automatic detection from being confused again?
> > >
> > > > Check out the --zero-superblock mode for mdadm. It is documented in 'man 8
> > > > mdadm'.
> > >
> > > cat:/home/lee# mdadm --zero-superblock /dev/sdb
> > > mdadm: Couldn't open /dev/sdb for write - not zeroing
> > >
> > >
> > > It's the same for sda. Do I need to stop all md devices involving
> > > these disks to remove the UUID? If so, how do you do it when it's not
> > > possible to stop them while the system is running (other than booting
> > > from CD or the like)?
> >
> > whilst booting add init=/bin/bash to the kernel options, or boot up
> > knoppix or something like it
>
> Oh. Does bash run with only the root partition mounted?

usually , there is also a way to get busybox loaded from the initrd
and have it drop into a command prompt

>
>
> --
> "Don't let them, daddy. Don't let the stars run down."
> http://adin.dyndns.org/adin/TheLastQ.htm
>
>
> --
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
>
>

--
Everything is controlled by a small evil group to which, unfortunately,
no one we know belongs.
 
Old 12-05-2008, 06:16 PM
lee
 
Default software raid 1: how to remove a UUID from a device?

On Fri, Dec 05, 2008 at 10:14:42AM +0100, Neil wrote:

> > Note that the physical devices /dev/sda and /dev/sdb have UUIDs
> > stored. How do I remove these UUIDs?
> >
>
> You can't. The UUID is calculated out of the properties of the disk
> (dunno wich exactly). It's like trying to remove the MD5 checsum of
> something: you can't.

You mean it's not stored on the disk but calculated every time? Then
how can /dev/sda have the same UUID as /dev/sdb?

As far as I understood it, mdadm writes these UUIDs so that they can
be used to recreate the arrays without entries for them in
mdadm.conf. That worked just fine on i386 when I connected the disks
after I got a larger case and installed the mdadm package. It worked
"just fine", sort of, after switching to x86_64, but differently in
that the UUIDs on the devices were "overriding" the UUIDs on the
partitions. Maybe I should send a bug report about it, but I can't
tell which version is buggy, the i386 or x86_64.

> However: your problem will be solvable and the guys who know how to do
> this are already busy.

Who is busy with this?

It's working now with the manually created entries in mdadm.conf ...

But I can't help thinking that this isn't how it should be,
i. e. maybe when installing the mdadm package, it should tell the user
what arrays have been found and will be created, and it should give
him a choice to start the md devices now or not. If I hadn't waited
for the resync on the wrongly set up array to finish, I might have
lost the data (a power failure might be enough) --- or a wrong
detection could actually destroy the data. It only asks you if and
what arrays should be brought up on system startup, and that is
obviously not enough.


--
"Don't let them, daddy. Don't let the stars run down."
http://adin.dyndns.org/adin/TheLastQ.htm


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 12-05-2008, 07:36 PM
"Boyd Stephen Smith Jr."
 
Default software raid 1: how to remove a UUID from a device?

On Friday 05 December 2008, lee <lee@yun.yagibdah.de> wrote about 'Re:
software raid 1: how to remove a UUID from a device?':
>On Fri, Dec 05, 2008 at 12:40:21PM +1100, Alex Samad wrote:
>> On Thu, Dec 04, 2008 at 07:10:44PM -0600, lee wrote:
>> > > On Thursday 2008 December 04 15:15, lee wrote:
>> > > > How do I remove the UUIDs from /dev/sda and /dev/sdb to prevent
>> > > > the automatic detection from being confused again?
>> > >
>> > > Check out the --zero-superblock mode for mdadm. It is documented
>> > > in 'man 8 mdadm'.
>> >
>> > cat:/home/lee# mdadm --zero-superblock /dev/sdb
>> > mdadm: Couldn't open /dev/sdb for write - not zeroing
>> >
>> >
>> > It's the same for sda. Do I need to stop all md devices involving
>> > these disks to remove the UUID? If so, how do you do it when it's not
>> > possible to stop them while the system is running (other than booting
>> > from CD or the like)?
>>
>> whilst booting add init=/bin/bash to the kernel options, or boot up
>> knoppix or something like it
>
>Oh. Does bash run with only the root partition mounted?

No, but there's few processes running so you can unmount most of the ones
that are mounted. Using fuser or similar tools, you can identify the
processes that are keeping the others from being unmounted, shutdown those
processes, and unmount the disks.

I've always been able to go down to / being the only mount point with a
real filesystem attached when starting with init=/bin/bash. If you have
to do something to the filesystem mounted on / though, you'll probably
want to boot from CD -- the initrd is somewhat limited.
--
Boyd Stephen Smith Jr. ,= ,-_-. =.
bss03@volumehost.net ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy `-'(. .)`-'
http://iguanasuicide.org/ \_/
 

Thread Tools




All times are GMT. The time now is 07:25 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org