Re: [Patch] mdadm: move mdadm.map file into /dev/md

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"NeilBrown" <neilb@xxxxxxx> writes:

> On Tue, April 7, 2009 10:16 pm, Doug Ledford wrote:
>> On Apr 7, 2009, at 2:05 AM, Goswin von Brederlow wrote:
>>> Doug Ledford <dledford@xxxxxxxxxx> writes:
>>>
>>>> Originally, mdadm used /var/run/mdadm/mdadm.map file to store the
>>>> temporary mappings of incrementally added devices to device names.
>>>> Unfortunately, this breaks incremental assembly if used early in the
>>>> booting process.  Specifically, root may still be read only.  Since
>>>> incremental assembly is largely a udev specific feature, and udev
>>>> needs a writable /dev tmpfs mount even when root is still read only,
>>>> it's safer to put our mdadm.map file in /dev/md so that we can write
>>>> to the map file no matter how early in the boot process we are
>>>> attempting to use incremental assembly.
>>>
>>> What about /lib/init/rw?
>>
>> Never heard of it.  But, if / is read-only, why wouldn't that also be
>> read-only?
>
> because a tmpfs was mounted there.  It's probably a Debian-specific
> thing.
>
> Why /var/run cannot be mounted from tmpfs nice and early too I don't know..

Because /var is not yet mounted.

You would have to create /var/run on the / filesystem, mount a tmpfs
there early during boot. Then later you would have to move the
filesystem somwhere else (/tmp/run?), mount /var and move it back. And
you would have a race condition where /var/run is not available for a
while.

> I understand that some people think /var/run needs to persist across
> reboots to preserve ownership of directories, but they are wrong :-)
> /var/run should be a tmpfs mount point very early.

Which Ubuntu defaults to and Debian is supporting but not defaulting to.

> I have to say that putting the map file in /dev feels very icky
> to me.  It isn't a device, and so doesn't belong in /dev.
> If we go around putting things somewhere convenient rather than
> where they belong, we quickly end up with a mess.
>
> So while it might be very pragmatic, I am currently dis-inclined
> to take the patch.   Can you try asking your boot-script people
> to make /var/run be an early tmpfs ???

Having /var/run early just complicates things needlessly.

Maybe mdadm should just have

  -m, --map <file>
     Filename of the map file for incremental operations. Defaults
     to /var/run/mdadm.map. Note that the default path might not exist
     or be read-only early in the boot process in which case a
     suitable alternative must be specified.

Wouldn't that be more flexible?

Debian could then set 'MAP /lib/init/rw' in its mdadm.conf.

> NeilBrown

MfG
        Goswin
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux