[xen-tools-discuss] Defining Partitions

Stéphane Jourdois sjourdois at gmail.com
Sun Oct 31 10:13:47 CET 2010


Le 30/10/2010 18:01, Stéphane Jourdois a écrit :
> Le 22/10/2010 16:19, Tim Bordemann a écrit :
>> My partitions.d/xfs looks like this:
>>
>> [boot]
>> size=200M
>> type=ext3
>> mountpoint=/boot
>> options=defaults
>>
>> [root]
>> size=300G
>> type=xfs
>> mountpoint=/
>> options=defaults
>>
>> [swap]
>> size=4G
>> type=swap
>>
>> Is this a bug or did I forget anything?
>
> Hi,
>
> Both, curiously: You did not order your partitions in "mount" order, and
> xen-tools neither did :-) So /foo/bar/boot was mounted before /foo/bar,
> and then the former could not be seen...

Hi again,

Just a quick clarification: mount(8) does the same, ie. it does not 
order your fstab, it reads it sequentially.

This is even documented in man 5 fstab :
"The order of records in fstab is important because fsck(8), mount(8), 
and umount(8) sequentially iterate through fstab doing their thing."

Last bit is that root filesystem is always mounted first in linux, so 
root cannot overlap others, and only problems are with /foo and /foo/bar 
filesystems.

I also checked that in util-linux-ng source code.

So... 2 things :
- the fix is wrong, we have to sort @PARTITIONS in the code, not just 
sort it when mounting, because fstab order will also be wrong in domU, 
even if the problem is solved for your use-case ;
- perhaps we should just do the same as mount(8), ie. mount root first, 
but mount others in order. This is a one-liner fix : unshift $part in 
@PARTITIONS if mountpoint is '/', instead of pushing it.

Thoughts ?
Stephane.

-- 
  ///  Stephane Jourdois     /"\  ASCII RIBBON CAMPAIGN \\\
(((    Consultant securite  \ /    AGAINST HTML MAIL    )))
  \\\   157 Bd Davout         X                         ///
   \\\  75020  Paris         / \    +33 6 8643 3085    ///


More information about the xen-tools-discuss mailing list