All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Soltys <soltys@ziu.info>
To: "michael@kmaclub.com" <michael@kmaclub.com>
Cc: linux-raid@vger.kernel.org
Subject: Re: Confused about UUID mounting and mirrors
Date: Tue, 17 Jun 2008 23:37:35 +0200	[thread overview]
Message-ID: <48582E9F.4000508@ziu.info> (raw)
In-Reply-To: <4856DB4C.20905@kmaclub.com>

michael@kmaclub.com wrote:
> 
> In /etc/fstab,  I have entries like this:
> 
> UUID=8e651838-38c1-4783-8bde-4174ec484d52 /     ext3    defaults  1 1
> UUID=aaeca70c-f0fe-470c-b631-87248648d275 /export xfs defaults,nobarrier 
> 1 2
> UUID=6e22c5b0-2874-4826-a871-ed733f8da643 swap swap    defaults   0 0
> UUID=323cd094-4cbe-4c3b-9096-366c05465e7c /export/services xfs defaults 1 2
> 
> 
> Do you have an example?  I am not sure I follow.
> 

Taken fragment from stock udev rules:

IMPORT{program}="vol_id --export $tempnode"

OPTIONS="link_priority=100"

ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*",
SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}"

ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*",
SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}"

- vol_id will export filesystem metadata, which udev will import and
make available for further rules in current uevent

- link_priority will prioritize uuid and label symlinks to the
filesystem found on md0, over existing or to-be-made symlinks
to mirror components. (actully - vol_id called for components will 
detect they are part of raid and return md's uuid along with USAGE=raid 
- so the link won't be even created in persistant storage rules).

- the rest will create appropriate symlinks

That's the general idea. Of coruse it's only a fragment. Check
60-persistent-storage.rules and 64-md-raid.rules from udev sources, to
see how things get done there.

E.g. in one fstab of mine (not uuids, the same idea though), there're:

/dev/disk/by-id/scsi-SATA_Maxtor_6Y120P0_Y32JMMQE-part1         /boot
ext2    defaults 0 0
/dev/disk/by-id/scsi-SATA_Maxtor_6Y120P0_Y32JMMQE-part2         swap
swap    defaults 0 0

> So what happens if someone sticks in a USB key and boots the machine. 
> The key bcomes sda, and each following drive shifts.  Is UDEV in this 
> case going to know to account for this?  The goal is to be able to 
> always find the filesystem regardless of what the disk name might be.
> 

That depends on the udev rules. With typical ones - your names would
shift, but symlinks created from /dev/disk/by-* directories would be proper.

You can even set sd{a,b,c,...} or any other names you want persistently
there, basing on the device's label, uuid or other traits - similary to
how network devices can be named persistently based on e.g. their mac
address. Still - with symlinks - there isn't much reason to.

When mdadm assembles your /dev/md0 - it usually looks for md's uuid
along other things (check your mdadm.conf) - so leaving /dev/md0 in
fstab should be perfectly fine. You can even name it /dev/grubboot - it
doesn't have to be md0.




  parent reply	other threads:[~2008-06-17 21:37 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-16 17:54 Confused about UUID mounting and mirrors michael
2008-06-16 20:41 ` Michal Soltys
2008-06-16 21:29   ` michael
2008-06-16 21:38     ` David Greaves
2008-06-17  2:29       ` michael
2008-06-17  7:11         ` Michael Tokarev
2008-06-17 14:19           ` michael
2008-06-17 16:10             ` Clive Messer
2008-06-18 14:00             ` Michael Tokarev
2008-06-18 14:42               ` michael
2008-06-20  2:17               ` michael
2008-06-17 19:17         ` Peter Grandi
2008-06-17 21:37     ` Michal Soltys [this message]
2008-06-19  3:56 ` Neil Brown
2008-06-22 20:05 ` Bill Davidsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48582E9F.4000508@ziu.info \
    --to=soltys@ziu.info \
    --cc=linux-raid@vger.kernel.org \
    --cc=michael@kmaclub.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.