Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved]Access aufs-rw dir after init
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
dasPaul
Apprentice
Apprentice


Joined: 14 Feb 2012
Posts: 243
Location: Dresden

PostPosted: Fri May 10, 2013 10:20 am    Post subject: [solved]Access aufs-rw dir after init Reply with quote

Hi there

I made my gentoo booting into an aufs-tmpfs-mount. Here is the snipped from my
initramfs:

Code:

pre stuff ....
# Mount the root filesystem.

mkdir -p /mnt/$ROOT_P
mount -o ro /dev/$ROOT_P /mnt/$ROOT_P   ## mount the squashfsimg containing device
mkdir /mnt/tmpfs
mount -t tmpfs -o size=$ROOT_SIZE tmpfs /mnt/tmpfs    ## create the the tmpfs
cp -a /mnt/sr0/m4 /mnt/tmpfs    ## copy the squashfsimg into tmpfs

umount /dev/$ROOT_P   ## remove the device

mkdir /mnt/ro_root  ## the readonly mountpoint of the squashfsimg & aufs
mkdir -p /mnt/tmpfs/rw   ## the readwrite part of the aufs where changes are stored
mount -o ro /mnt/tmpfs/m4 /mnt/ro_root || rescue_shell   ## mount the squashfsimg to readonly
mount -t aufs -o br=/mnt/tmpfs/rw:/mnt/ro_root none /mnt/root  ## mount the final aufs to newroot
...
cleaning
switch_root...


So far this works, but after gentoo has booted I would like to access the dir containing the changes stored by aufs (should be /mnt/tmpfs/rw). But after login my mounts are only:


Code:

mount:

rootfs on / type rootfs (rw)
tmpfs on /mnt/tmpfs type tmpfs (rw,relatime,size=1536000k)
/dev/loop0 on /mnt/ro_root type squashfs (ro,relatime)
none on / type aufs (rw,relatime,si=97dd6d33cdfc9433)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
tmpfs on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=10240k,nr_inodes=505505,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620)
shm on /dev/shm type tmpfs (rw,nosuid,nodev,noexec,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
cgroup_root on /sys/fs/cgroup type tmpfs (rw,nosuid,nodev,noexec,relatime,size=10240k,mode=755)
openrc on /sys/fs/cgroup/openrc type cgroup (rw,nosuid,nodev,noexec,relatime,release_agent=/lib64/rc/sh/cgroup-release-agent.sh,name=openrc)
cpuset on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cpu on /sys/fs/cgroup/cpu type cgroup (rw,nosuid,nodev,noexec,relatime,cpu)
cpuacct on /sys/fs/cgroup/cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpuacct)
freezer on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,nodev,noexec,nosuid)


my /mnt dir is empty

Is there any way to access the "/mnt/tmpfs/rw" from the init?
Back to top
View user's profile Send private message
dasPaul
Apprentice
Apprentice


Joined: 14 Feb 2012
Posts: 243
Location: Dresden

PostPosted: Mon May 13, 2013 10:02 am    Post subject: Reply with quote

Solved by:

Quote:

Cc: aufs-users <aufs-users@lists.sourceforge.net>
Betreff: Re: (initramfs) How to access rw-part after switch_root ?


You should probably save it with a bind mount before cleanup:

mkdir -p /mnt/root/rw
mount -o bind /mnt/tmpfs/rw /mnt/root/rw

then after the switch-root you can look in /rw to find all the modifications
that have been made
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum