linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Mount multiple-device-filesystem by UUID
@ 2013-07-27 18:50 Hendrik Friedel
  2013-07-27 18:52 ` Hendrik Friedel
  0 siblings, 1 reply; 6+ messages in thread
From: Hendrik Friedel @ 2013-07-27 18:50 UTC (permalink / raw)
  To: linux-btrfs

Hello,

As stated in the

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Mount multiple-device-filesystem by UUID
  2013-07-27 18:50 Mount multiple-device-filesystem by UUID Hendrik Friedel
@ 2013-07-27 18:52 ` Hendrik Friedel
  2013-07-27 19:44   ` Hugo Mills
  0 siblings, 1 reply; 6+ messages in thread
From: Hendrik Friedel @ 2013-07-27 18:52 UTC (permalink / raw)
  To: linux-btrfs

Hello,

As stated in the wiki, multiple-device filesystems (e.g. raid 1) will 
only mount after a btfs device scan, or if all devices are passed with 
the mount options.

I remember, that for Ubuntu 12.04 I changed the initrd. But after a 
re-install, I have to do this again, and I don't remember how I did it.

So, the other option would be passing the devices in the fstab. But 
here, I'd prefer UUIDs rather than device names, as they can change.

Is this possible? What is the syntax?

Regards,
Hendrik



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Mount multiple-device-filesystem by UUID
  2013-07-27 18:52 ` Hendrik Friedel
@ 2013-07-27 19:44   ` Hugo Mills
  2013-07-27 22:14     ` Duncan
                       ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Hugo Mills @ 2013-07-27 19:44 UTC (permalink / raw)
  To: Hendrik Friedel; +Cc: linux-btrfs

[-- Attachment #1: Type: text/plain, Size: 1096 bytes --]

On Sat, Jul 27, 2013 at 08:52:50PM +0200, Hendrik Friedel wrote:
> As stated in the wiki, multiple-device filesystems (e.g. raid 1)
> will only mount after a btfs device scan, or if all devices are
> passed with the mount options.
> 
> I remember, that for Ubuntu 12.04 I changed the initrd. But after a
> re-install, I have to do this again, and I don't remember how I did
> it.

   With Ubuntu, just install the btrfs-tools package. It should modify
the initrd correctly.

> So, the other option would be passing the devices in the fstab. But
> here, I'd prefer UUIDs rather than device names, as they can change.

   This is why we don't recommend using device= mount flags.

> Is this possible? What is the syntax?

   I don't believe it is possible. Finding filesystems by UUID is (I
think) a userspace-based thing, so you'd have to have an initrd
anyway.

   Hugo.

-- 
=== Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
  PGP key: 65E74AC0 from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
   --- "No!  My collection of rare, incurable diseases! Violated!" ---   

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Mount multiple-device-filesystem by UUID
  2013-07-27 19:44   ` Hugo Mills
@ 2013-07-27 22:14     ` Duncan
       [not found]     ` < pan$b873b$34bc7363$e7fad079$c205b803@cox.net>
  2013-07-28 18:57     ` Hendrik Friedel
  2 siblings, 0 replies; 6+ messages in thread
From: Duncan @ 2013-07-27 22:14 UTC (permalink / raw)
  To: linux-btrfs

Hugo Mills posted on Sat, 27 Jul 2013 20:44:48 +0100 as excerpted:

> On Sat, Jul 27, 2013 at 08:52:50PM +0200, Hendrik Friedel wrote:
>> As stated in the wiki, multiple-device filesystems (e.g. raid 1) will
>> only mount after a btfs device scan, or if all devices are passed with
>> the mount options.
>> 
>> I remember, that for Ubuntu 12.04 I changed the initrd. But after a
>> re-install, I have to do this again, and I don't remember how I did it.
> 
>    With Ubuntu, just install the btrfs-tools package. It should modify
> the initrd correctly.
> 
>> So, the other option would be passing the devices in the fstab. But
>> here, I'd prefer UUIDs rather than device names, as they can change.
> 
>    This is why we don't recommend using device= mount flags.
> 
>> Is this possible? What is the syntax?
> 
>    I don't believe it is possible. Finding filesystems by UUID is (I
> think) a userspace-based thing, so you'd have to have an initrd anyway.

btrfs raid1 root here, was initr*less until I switched to btrfs which is 
broken with direct-kernel-root-mount rootflags=device=whatever syntax.

UUIDs are indeed userspace -- udev/systemd.  However, if your initr* 
includes udev, at least here, it "just works".

I use root=LABEL=whatever here on the kernel commandline for root, and 
LABEL=whatever for non-root in fstab, but as long as udev has the 
directory in /dev/disk/*, mount should work with it, so root=UUID=whatever 
at the kernel commandline should work, as should UUID=whatever in fstab 
as the first field.

-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Mount multiple-device-filesystem by UUID
       [not found]     ` < pan$b873b$34bc7363$e7fad079$c205b803@cox.net>
@ 2013-07-28  8:37       ` Duncan
  0 siblings, 0 replies; 6+ messages in thread
From: Duncan @ 2013-07-28  8:37 UTC (permalink / raw)
  To: linux-btrfs

Duncan posted on Sat, 27 Jul 2013 22:14:02 +0000 as excerpted:

> btrfs raid1 root here, was initr*less until I switched to btrfs which is
> broken with direct-kernel-root-mount rootflags=device=whatever syntax.
> 
> UUIDs are indeed userspace -- udev/systemd.  However, if your initr*
> includes udev, at least here, it "just works".
> 
> I use root=LABEL=whatever here on the kernel commandline for root, and
> LABEL=whatever for non-root in fstab, but as long as udev has the
> directory in /dev/disk/*, mount should work with it, so
> root=UUID=whatever at the kernel commandline should work, as should
> UUID=whatever in fstab as the first field.

I can add...

* I use dracut as my initramfs generator, but with some of the default 
modules stripped in ordered to create a leaner initramfs.

* It has a(n optional but obviously activated here) btrfs module that 
among other things, runs btrfs device scan before attempting to mount 
real-root.  That's the critical bit that should be in your initramfs 
before attempting to mount a multi-device btrfs.  With the btrfs 
executable and a call to btrfs device scan, mount, and udev creating the 
/dev/disk/by-*/ subdirs, an initramfs environment should really handle 
pretty much all the mount options available to you at a full-booted 
commandline.

-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Mount multiple-device-filesystem by UUID
  2013-07-27 19:44   ` Hugo Mills
  2013-07-27 22:14     ` Duncan
       [not found]     ` < pan$b873b$34bc7363$e7fad079$c205b803@cox.net>
@ 2013-07-28 18:57     ` Hendrik Friedel
  2 siblings, 0 replies; 6+ messages in thread
From: Hendrik Friedel @ 2013-07-28 18:57 UTC (permalink / raw)
  To: Hugo Mills, linux-btrfs

Thanks for your replies.

I will try.

Greetings,
Hendrik

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-07-28 18:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-27 18:50 Mount multiple-device-filesystem by UUID Hendrik Friedel
2013-07-27 18:52 ` Hendrik Friedel
2013-07-27 19:44   ` Hugo Mills
2013-07-27 22:14     ` Duncan
     [not found]     ` < pan$b873b$34bc7363$e7fad079$c205b803@cox.net>
2013-07-28  8:37       ` Duncan
2013-07-28 18:57     ` Hendrik Friedel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).