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 04-09-2008, 03:08 AM
Mitchell Laks
 
Default using UUID's for a raid1 in /etc/fstab instead of /dev/md0

Hi,

Someone recently talked about using
ls -l /dev/disk/by-uuid

to figure out the correct UUID to put into /etc/fstab
for hard drives.

I have /home on a raid1 /dev/md0 which is composed of two drive partitions
/dev/sda1
/dev/sdb1

Now in /etc/mdadm/mdadm.conf
I have:
ARRAY /dev/md0 level=raid1 num-devices=2 UUID=3cfd16a0:6eaa64dd:0dfcf1b5:2690c9eb

Now, I thought to try that UUID, but when I tried that
and put the line
/etc/fstab
using

http://linuxbasics.org/tutorials/during/uuid_naming?rev=1207514451

thus
UUID=3cfd16a0:6eaa64dd:0dfcf1b5:2690c9eb /home ext3 defaults,errors=remount-ro 0 1

It was a real bust and dropped me into control d boot land. I then fixed it
/etc/fstab back to /dev/md0 and all was ok.

So that must be the UUID for the individual /dev/sda1 and /dev/sdb1.

What is the UUID for the raid1 itself?

Thanks.
Mitchell




--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 04-09-2008, 03:31 AM
"Douglas A. Tutty"
 
Default using UUID's for a raid1 in /etc/fstab instead of /dev/md0

On Tue, Apr 08, 2008 at 11:08:11PM -0400, Mitchell Laks wrote:
> Someone recently talked about using
> ls -l /dev/disk/by-uuid

> So that must be the UUID for the individual /dev/sda1 and /dev/sdb1.
>
> What is the UUID for the raid1 itself?

Doesn't matter. The raid subsystem will search all disks for raid
members irrespective of /dev name when it reassembles the raid on boot.
/dev/md0 will always be /dev/md0 and not /dev/md3 or something.

FYI, LVM is the same way, only its /dev/mapper...

Doug.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 04-09-2008, 04:09 AM
NN_il_Confusionario
 
Default using UUID's for a raid1 in /etc/fstab instead of /dev/md0

On Tue, Apr 08, 2008 at 11:08:11PM -0400, Mitchell Laks wrote:
> ls -l /dev/disk/by-uuid
> So that must be the UUID for the individual /dev/sda1 and /dev/sdb1.
> What is the UUID for the raid1 itself?

Perhaps blkid might help

(at lest it works for me, and my machines do NON use udev and do NOT
have /dev/disk/by-uuid)

--
Chi usa software non libero avvelena anche te. Digli di smettere.
Informatica=arsenico: minime dosi in rari casi patologici, altrimenti letale.
Informatica=bomba: intelligente solo per gli stupidi che ci credono.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 04-09-2008, 04:18 AM
"Owen Townend"
 
Default using UUID's for a raid1 in /etc/fstab instead of /dev/md0

On 09/04/2008, Douglas A. Tutty <dtutty@porchlight.ca> wrote:
On Tue, Apr 08, 2008 at 11:08:11PM -0400, Mitchell Laks wrote:
> Someone recently talked about using
> ls -l /dev/disk/by-uuid


> So that must be the UUID for the individual /dev/sda1 and /dev/sdb1.

>
> What is the UUID for the raid1 itself?


Doesn't matter.**The raid subsystem will search all disks for raid
members irrespective of /dev name when it reassembles the raid on boot.
/dev/md0 will always be /dev/md0 and not /dev/md3 or something.


FYI, LVM is the same way, only its /dev/mapper...

Doug.
Hey,

The*raid*subsystem*writes*headers*to*the*disks*the mselves*which*include*a*uuid*array*identifier and a prefered device number (eg 0 for md0).*It*uses*this*to*gather*array*members*and*the n*presents*the*array*as*/dev/md0.

This means, as Doug said, that you can put the disks back in any order, on any controller ( or over a network*-*check*'write-mostly' ) and the*resultant*block*devices*(eg*/dev/sda) are in the search path (check mdadm.conf) the array will build.

So long as there aren't two or more arrays requesting the same dev number (eg for md0) then each should get their preference.

The array itself does have a uuid (check `mdadm --detail /dev/md0|grep UUID`), but I have never tried using it as the boot argument.


cheers,
Owen.

n.b. I'm on a windows comp at the moment*so*take*above*as all 'IIRC'.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 04-09-2008, 06:03 AM
martin f krafft
 
Default using UUID's for a raid1 in /etc/fstab instead of /dev/md0

also sprach Mitchell Laks <mlaks@post.harvard.edu> [2008.04.09.0508 +0200]:
> Someone recently talked about using ls -l /dev/disk/by-uuid
>
> to figure out the correct UUID to put into /etc/fstab for hard
> drives.

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=435983

--
.'`. martin f. krafft <madduck@debian.org>
: :' : proud Debian developer, author, administrator, and user
`. `'` http://people.debian.org/~madduck - http://debiansystem.info
`- Debian - when you have better things to do than fixing systems

"self-denial is the shining sore
on the leprous body of christianity."
-- oscar wilde
 
Old 04-09-2008, 07:10 AM
Alex Samad
 
Default using UUID's for a raid1 in /etc/fstab instead of /dev/md0

On Tue, Apr 08, 2008 at 11:08:11PM -0400, Mitchell Laks wrote:
> Hi,
>
> Someone recently talked about using
> ls -l /dev/disk/by-uuid
>
> to figure out the correct UUID to put into /etc/fstab
> for hard drives.
>
> I have /home on a raid1 /dev/md0 which is composed of two drive partitions
> /dev/sda1
> /dev/sdb1
>
> Now in /etc/mdadm/mdadm.conf
> I have:
> ARRAY /dev/md0 level=raid1 num-devices=2 UUID=3cfd16a0:6eaa64dd:0dfcf1b5:2690c9eb
>
> Now, I thought to try that UUID, but when I tried that
> and put the line
> /etc/fstab
> using
>
> http://linuxbasics.org/tutorials/during/uuid_naming?rev=1207514451
>
> thus
> UUID=3cfd16a0:6eaa64dd:0dfcf1b5:2690c9eb /home ext3 defaults,errors=remount-ro 0 1
>
> It was a real bust and dropped me into control d boot land. I then fixed it
> /etc/fstab back to /dev/md0 and all was ok.
thats because you have placed the UUID of the parts not the fs system
that exists on the raid

try tune2fs -l /dev/md0 and use the UUID from there

>
> So that must be the UUID for the individual /dev/sda1 and /dev/sdb1.
>
> What is the UUID for the raid1 itself?
>
> Thanks.
> Mitchell
>
>
>
>
> --
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
>
>

--
"After all, a week ago, there were -- Yasser Arafat was boarded up in his building in Ramallah, a building full of, evidently, German peace protestors and all kinds of people. They're now out. He's now free to show leadership, to lead the world."

- George W. Bush
05/02/2002
Washington, DC
 
Old 04-09-2008, 02:27 PM
"Damon L. Chesser"
 
Default using UUID's for a raid1 in /etc/fstab instead of /dev/md0

Alex Samad wrote:

On Tue, Apr 08, 2008 at 11:08:11PM -0400, Mitchell Laks wrote:


Hi,

Someone recently talked about using
ls -l /dev/disk/by-uuid


to figure out the correct UUID to put into /etc/fstab
for hard drives.


I have /home on a raid1 /dev/md0 which is composed of two drive partitions
/dev/sda1
/dev/sdb1

Now in /etc/mdadm/mdadm.conf
I have:
ARRAY /dev/md0 level=raid1 num-devices=2 UUID=3cfd16a0:6eaa64dd:0dfcf1b5:2690c9eb

Now, I thought to try that UUID, but when I tried that
and put the line
/etc/fstab

using

http://linuxbasics.org/tutorials/during/uuid_naming?rev=1207514451

thus
UUID=3cfd16a0:6eaa64dd:0dfcf1b5:2690c9eb /home ext3 defaults,errors=remount-ro 0 1

It was a real bust and dropped me into control d boot land. I then fixed it
/etc/fstab back to /dev/md0 and all was ok.


thats because you have placed the UUID of the parts not the fs system
that exists on the raid

try tune2fs -l /dev/md0 and use the UUID from there



So that must be the UUID for the individual /dev/sda1 and /dev/sdb1.

What is the UUID for the raid1 itself?

Thanks.
Mitchell




--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org








I looked at tune2fs -l /dev/md0:
Filesystem UUID: d3bb5b79-2d5f-438d-a60e-5437e80e2edf

from ls -l /dev/disk/by-uuid

root root 9 2008-04-07 12:51 d3bb5b79-2d5f-438d-a60e-5437e80e2edf ->
../../md0


As you can see, same UUID. So then I went to look at /etc/fstab:

# /dev/md0
UUID=d3bb5b79-2d5f-438d-a60e-5437e80e2edf /home ext3
defaults 0 2


As you can see, same uuid and md0 is mounted by uuid.

from my menu.lst

title Ubuntu 7.10, kernel 2.6.22-14-generic
root (hd0,5)
kernel /boot/vmlinuz-2.6.22-14-generic root=UUID=cbec0e90-a36f-4850-8da0-8c4ab3d94247 ro quiet splash
initrd /boot/initrd.img-2.6.22-14-generic

different uuid becuse / is not on a raid, only /home is. From fstab for /:

# /dev/hda6
UUID=cbec0e90-a36f-4850-8da0-8c4ab3d94247 / ext3
defaults,errors=remount-ro 0 1


Disclaimer, this is NOT debian, but ubuntu 7.10. Due to not being able
to print in debian, I am currently forced to run ubuntu. Very close to
debian though.


What you did not say was what version of Debian are you running? It all
works here. There is the bug listed above but the dev says that sid does
not fix the issue. If you are running ubuntu, it should work. (it does
here, YMMV.). But then again, it always worked for me in Debian also.


HTH?

--
Damon L. Chesser
damon@damtek.com



--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 04-09-2008, 08:55 PM
Alex Samad
 
Default using UUID's for a raid1 in /etc/fstab instead of /dev/md0

On Wed, Apr 09, 2008 at 10:27:43AM -0400, Damon L. Chesser wrote:
> Alex Samad wrote:
>> On Tue, Apr 08, 2008 at 11:08:11PM -0400, Mitchell Laks wrote:
>>
>>> Hi,
>>>
[snip]
>>
> I looked at tune2fs -l /dev/md0:
> Filesystem UUID: d3bb5b79-2d5f-438d-a60e-5437e80e2edf
>
> from ls -l /dev/disk/by-uuid
>
> root root 9 2008-04-07 12:51 d3bb5b79-2d5f-438d-a60e-5437e80e2edf ->
> ../../md0
>
> As you can see, same UUID. So then I went to look at /etc/fstab:
>
> # /dev/md0
> UUID=d3bb5b79-2d5f-438d-a60e-5437e80e2edf /home ext3
> defaults 0 2
>
> As you can see, same uuid and md0 is mounted by uuid.
>
> from my menu.lst
>
> title Ubuntu 7.10, kernel 2.6.22-14-generic
> root (hd0,5)
> kernel /boot/vmlinuz-2.6.22-14-generic root=UUID=cbec0e90-a36f-4850-8da0-8c4ab3d94247 ro quiet splash
> initrd /boot/initrd.img-2.6.22-14-generic
>
> different uuid becuse / is not on a raid, only /home is. From fstab for /:
>
> # /dev/hda6
> UUID=cbec0e90-a36f-4850-8da0-8c4ab3d94247 / ext3
> defaults,errors=remount-ro 0 1
>
> Disclaimer, this is NOT debian, but ubuntu 7.10. Due to not being able
> to print in debian, I am currently forced to run ubuntu. Very close to
> debian though.
>
> What you did not say was what version of Debian are you running? It all
> works here. There is the bug listed above but the dev says that sid does
> not fix the issue. If you are running ubuntu, it should work. (it does
> here, YMMV.). But then again, it always worked for me in Debian also.

I am on amd64 lenny (with some sid), 2.6.24
I don't normally use UUID's i have been using labels

mdadm --detail /dev/md1 | grep UUID
UUID : ba8c4627:6e74a6c4:1a2e6c15:22feafcf
tune2fs -l /dev/md1 | grep UUID
Filesystem UUID: ec3e3537-4e36-443e-8132-5b0f03dd0978

As you can see the UUID ids are different between md1, I don't have a
/dev/disk/by-uuid (i remember having it before)

here is the output of blkid (which i believe is used to make up the links
in /dev/disk/by-uuid)
blkid | grep md1
/dev/md1: LABEL="/" UUID="ec3e3537-4e36-443e-8132-5b0f03dd0978"
SEC_TYPE="ext2" TYPE="ext3"

so if i wanted to mount my / partition (/dev/md0 is /boot), then I could
put
UUID=ec3e3537-4e36-443e-8132-5b0f03dd0978 / auto ...... in my fstab file

Alex
>
> HTH?
>
> --
> Damon L. Chesser
> damon@damtek.com
>
>
>
> --
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a
> subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
>
>

--
I have a terrible headache, I was putting on toilet water and the lid fell.
 
Old 04-09-2008, 09:09 PM
"Damon L. Chesser"
 
Default using UUID's for a raid1 in /etc/fstab instead of /dev/md0

SNIP


I am on amd64 lenny (with some sid), 2.6.24
I don't normally use UUID's i have been using labels

mdadm --detail /dev/md1 | grep UUID
UUID : ba8c4627:6e74a6c4:1a2e6c15:22feafcf
tune2fs -l /dev/md1 | grep UUID
Filesystem UUID: ec3e3537-4e36-443e-8132-5b0f03dd0978

As you can see the UUID ids are different between md1, I don't have a
/dev/disk/by-uuid (i remember having it before)

here is the output of blkid (which i believe is used to make up the links
in /dev/disk/by-uuid)
blkid | grep md1
/dev/md1: LABEL="/" UUID="ec3e3537-4e36-443e-8132-5b0f03dd0978"
SEC_TYPE="ext2" TYPE="ext3"

so if i wanted to mount my / partition (/dev/md0 is /boot), then I could
put
UUID=ec3e3537-4e36-443e-8132-5b0f03dd0978 / auto ...... in my fstab file

Alex



Alex,

I think you have it, though I can't explain the different UUIDs from
tune2fs and mdadm --detail. I would rather put in the fs type rather
then auto, but that is a matter of style. What is the result?


damon@damtek.com


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 04-10-2008, 03:49 AM
Alex Samad
 
Default using UUID's for a raid1 in /etc/fstab instead of /dev/md0

On Wed, Apr 09, 2008 at 05:09:05PM -0400, Damon L. Chesser wrote:
> SNIP
>>
>> I am on amd64 lenny (with some sid), 2.6.24
>> I don't normally use UUID's i have been using labels
>>
>> mdadm --detail /dev/md1 | grep UUID
>> UUID : ba8c4627:6e74a6c4:1a2e6c15:22feafcf
>> tune2fs -l /dev/md1 | grep UUID
>> Filesystem UUID: ec3e3537-4e36-443e-8132-5b0f03dd0978
>>
>> As you can see the UUID ids are different between md1, I don't have a
>> /dev/disk/by-uuid (i remember having it before)
>>
>> here is the output of blkid (which i believe is used to make up the links
>> in /dev/disk/by-uuid)
>> blkid | grep md1
>> /dev/md1: LABEL="/" UUID="ec3e3537-4e36-443e-8132-5b0f03dd0978"
>> SEC_TYPE="ext2" TYPE="ext3"
>>
>> so if i wanted to mount my / partition (/dev/md0 is /boot), then I could
>> put
>> UUID=ec3e3537-4e36-443e-8132-5b0f03dd0978 / auto ...... in my fstab file
>>
>> Alex
>>
>>
> Alex,
>
> I think you have it, though I can't explain the different UUIDs from
> tune2fs and mdadm --detail. I would rather put in the fs type rather
well tune2fs is looking at the fs which is ontop of the raid1

I also have a md2 which is a lvm pv, I can do a mdadm --detail on it and
get a uuid, but the filesystems on there are managed by lvm.

I would guess why it loads when you use the UUID of the raid1, is
because it would be the same as specifying /dev/sda1 (a partition)

alex

> then auto, but that is a matter of style. What is the result?

>
> damon@damtek.com
>
>
> --
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a
> subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
>
>

--
"Oftentimes, we live in a processed world -- you know, people focus on the process and not results."

- George W. Bush
05/29/2003
Washington, DC
 

Thread Tools




All times are GMT. The time now is 09:01 PM.

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