[buildd-tools-devel] Bug#679726: aufs

Nicholas Bamber nicholas at periapt.co.uk
Mon Jul 2 21:32:19 UTC 2012


On 02/07/12 22:12, Roger Leigh wrote:
> On Mon, Jul 02, 2012 at 09:30:36PM +0100, Nicholas Bamber wrote:
>> I have not got very far with aufs yet. Obviously I need to rtfm a bit
>> more. However I have tried to follow the scroot scripts as best as I can
>> and what I get is as follows:
> 
> The only bit that matters is in 10mount (05union just creates
> and removes the directories for the "overlay" and "underlay"):
> 
> CHROOT_UNION_MOUNT_OPTIONS=br:${CHROOT_UNION_OVERLAY_DIRECTORY}:${CHROOT_UNION_UNDERLAY_DIRECTORY}=ro
> mount -t "$CHROOT_UNION_TYPE" -o "$CHROOT_UNION_MOUNT_OPTIONS" "$CHROOT_NAME" "$1"
> 
> So you just need to try doing
> 
> mount -t aufs -o "br:${overlay}:${underlay}=ro" ${name} ${mountpoint}
> 
> where
>   overlay=overlay directory
>   underlay=underlay directory
>   name=any name you like
>   mountpoint=where to mount
> 
> If you can do that directly on the host system as root, then aufs
> is working properly.  But if it's not, something is wrong, either
> with the setup script, or with how schroot has been configured.
> 
> Here's an example:
> 
> % mkdir /tmp/a /tmp/b
> % touch /tmp/a/1 /tmp/b/2
> % ls /tmp/a /tmp/b
> /tmp/a:
> 1
> 
> /tmp/b:
> 2
> % sudo mount -t aufs -o "br:/tmp/a:/tmp/b=ro" testaufs /mnt    
> % mount | tail -n 1
> testaufs on /mnt type aufs (rw,relatime,si=68977b847b3d0288)
> ravenclaw% ls /mnt
> 1  2
> ravenclaw% touch /mnt/3
> ravenclaw% ls /tmp/a /tmp/b
> /tmp/a:
> 1  3
> 
> /tmp/b:
> 2
> 
> So you can see that /tmp/a is the writable overlay, so files
> created in /mnt go into /tmp/a, and /tmp/b is the read-only
> underlay.  If you can do the above, then aufs is working
> correctly.  Note that I did a "modprobe aufs" beforehand,
> but this should not be necessary.
> 
> On the schroot side, you shouldn't need to do anything more
> than set union-type=aufs.  Everything else should be automatic--
> the chroot filesystem should be mounted/bind mounted/unpacked
> on the underlay, and an empty directory should be the overlay.
> 
> 
> Hope this helps,
> Roger
> 


nicholas at taylor:/home/sisyphus$ mkdir /tmp/a /tmp/b
nicholas at taylor:/home/sisyphus$ touch /tmp/a/1 /tmp/b/2
nicholas at taylor:/home/sisyphus$ ls /tmp/a /tmp/b
/tmp/a:
1

/tmp/b:
2


root at taylor:/mnt/share/childrens computer# mount -t aufs -o
"br:/tmp/a:/tmp/b=ro" testaufs /mnt
root at taylor:/mnt/share/childrens computer#


nicholas at taylor:/home/sisyphus$  mount | tail -n 1
testaufs on /mnt type aufs (rw,relatime,si=c13e1559eaba3ef4)
nicholas at taylor:/home/sisyphus$ ls /mnt
1  2
nicholas at taylor:/home/sisyphus$ touch /mnt/3
nicholas at taylor:/home/sisyphus$ ls /tmp/a /tmp/b
/tmp/a:
1  3

/tmp/b:
2





More information about the Buildd-tools-devel mailing list