Patrick schrieb:
> Patrick schrieb:
>> Patrick schrieb:
>>> Flemming Madsen schrieb:
>>>  
>>>> Patrick wrote:
>>>>     
>>>>> But isnt there another way? e.g. copying / mount-moving/binding 
>>>>> real_root to the union or something like that?
>>>>>
>>>>>           
>>>> The way i make access to the underlying filesystems is to 'mount -o
>>>> move' the underlying
>>>> mount point into the union berfore i chroot into it.
>>>>
>>>> In my setup i have in the flash:
>>>>
>>>> - A squashfs root filesystem to boot on
>>>> - A ram filesyatem to pickup writes
>>>> - A /flash to persist things
>>>> - The /flash/root directory for patching the squashfs root
>>>>
>>>> I have these in /mnt and move them into the union to have access to 
>>>> the
>>>> underlying
>>>> filesystems after the chroot
>>>>
>>>> Sketchy: Eg. (with unionfs)
>>>>
>>>> mount /mnt/ram/
>>>> mount /mnt/flash/
>>>> mount / /mnt/initroot -o bind
>>>>
>>>> mount -t unionfs unionfs /mnt/union -o
>>>> dirs=/mnt/ram:/mnt/flash/root=ro:/mnt/initroot=ro
>>>>
>>>> mount /mnt/flash    /mnt/union/mnt/flash      -o move
>>>> mount /mnt/ram      /mnt/union/mnt/ram        -o move
>>>> mount /mnt/initroot /mnt/union/mnt/initroot   -o move
>>>>
>>>> cd /mnt/union
>>>> chroot . init # Rock & roll
>>>>       
>>> Heh, thats what I exactly tried myself .. but here it doesnt work . 
>>> none of the mounted filesystems that were moved are accessable / 
>>> viewable in the union later on.
>>>
>>>   
>> heh okay, got that one fixed (added some sleep's and seen it was a 
>> typo tho.. now my question is .. your /mnt/ram is tmpfs I guess while 
>> /mnt/flash is where? like where is it actually stored? (only thing I 
>> can imagine is onto the rootfs)
>>
> Hmm .. well I think I was wrong with that assumption .. seems as if 
> your /flash is on another partition/device than the rootfs is .. 
> otherwise it wouldnt work, would it since the rootfs is mounted ro .. 
> enlighten me please!
>

Finally ... I reconfirmed my statement, that /flash cant be within the 
actual rootfs .. (tried a loop device tho, and aufs moans about 
overlapping) .. now I used a dedicated partition .. so it is like:

/new is a tmpfs and /real_root is the real rootfs .. now /flash is on 
another partition and I mount the unionfs like mount -w -t aufs -o 
dirs=/new=rw:/flash=ro:/real_root=ro aufs /union .. so when changing 
something on the unified FS changes go to /new obviously .. and if I put 
for instance /etc/fstab into /flash .. I can have persistent changes.

But that is not exactly what I wanted, so I thought of a method having 
the rootfs under /flash too (so I can easily change files without 
copying them + their appropiate dirs to /flash) .. Thus I introduced 
another directory calld /change .. moved it to the unified fs (same with 
/real_root) and now my init of initramfs looks like:

mkdir -p /real_root
mkdir -p /new
mkdir -p /change
mkdir -p /flash

mount -w -t aufs -o dirs=/new=rw:/flash=ro:/real_root=ro none /union

mkdir -p /union/mnt/new
mkdir -p /union/mnt/real_root
mkdir -p /union/mnt/flash
mkdir -p /union/mnt/change
mount -o move /new ${rootmnt}/mnt/new
mount -o move /real_root ${rootmnt}/mnt/real_root
mount -o move /flash ${rootmnt}/mnt/flash
mount -w -t aufs -o 
dirs=${rootmnt}/mnt/flash=rw:${rootmnt}/mnt/real_root=ro aufs /change
mount -o move /change ${rootmnt}/mnt/change

Now to explain that: Once I want a persistent change ... I easily adapt 
the files in /mnt/change .. so the changes go to /mnt/flash .. while 
/mnt/flash is in hierachy higher than /real_root .. the changes are 
persistent ...
I hope this may help other users who run in a similar kind of problem :-)


regards,
Patrick



> regards,
> Patrick
>
>>> regards,
>>> Patrick
>>>  
>>>> ------------------------------------------------------------------------- 
>>>>
>>>> Take Surveys. Earn Cash. Influence the Future of IT
>>>> Join SourceForge.net's Techsay panel and you'll get the chance to 
>>>> share your
>>>> opinions on IT & business topics through brief surveys-and earn cash
>>>> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV 
>>>>
>>>>
>>>>       
>>>
>>>
>>> ------------------------------------------------------------------------- 
>>>
>>> Take Surveys. Earn Cash. Influence the Future of IT
>>> Join SourceForge.net's Techsay panel and you'll get the chance to 
>>> share your
>>> opinions on IT & business topics through brief surveys-and earn cash
>>> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV 
>>>
>>>
>>>   
>>
>>
>
>


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

Reply via email to