On Jan 26, 2008, at 8:15 PM, Fred wrote:

> Lonnie
>
> At 12:31 26/01/2008 -0600, Lonnie Abelbeck wrote:
>> Well, the unionfs "rw" overlay to the "ro" base mount is CF  
>> based,  but
>> most any files that are written-to on a constant basis are   
>> mounted as
>> "tmpfs" which is a RAM based filesystem.
>
> OK. So am I right in thinking that for development, I save files  
> to /tmp
> like there's no tomorrow since those write's are actually made in  
> RAM, and
> only save the program to eg. /usr/local/bin once it's debugged?
>
> In other words, if I want stuff written to /var to survive a  
> reboot, I must
> edit /etc/fstab to remove the line for /var, copy files from /var to
> /dev/hda2 somehow, reboot, and from then on, AstLinux will use hda2  
> to hold
> /var?
>
> Here's what I have after adding /dev/hda2 as UnionFS:
>
> ======
> pbx ~ # mount
> rootfs on / type rootfs (rw)
> /dev/root on /oldroot type ext2 (rw)
> /dev/hda1 on /oldroot/cdrom type vfat
> (ro,fmask=0022,dmask=0022,codepage=cp437,iocharset=iso8859-1)
> /dev/hda2 on /oldroot/mnt/asturw type ext2 (rw,noatime)
> none on /oldroot/mnt/asturo type tmpfs (ro)
> none on / type unionfs (rw,dirs=/oldroot/mnt/asturw=rw:/oldroot/mnt/ 
> asturo=ro)
> none on /proc type proc (rw)
> none on /dev type tmpfs (rw)
> none on /var type tmpfs (rw)
> none on /tmp type tmpfs (rw)
> none on /sys type sysfs (rw)
> usbfs on /proc/bus/usb type usbfs (rw)
> none on /dev/pts type devpts (rw)
> none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
> pbx ~ #
> ======

Kevin,

Great question, and I am no unionfs expert by any stretch, I'm  
learning by doing, but this is how I understand things.

First, no fstab editing should be necessary, if you organize things  
properly.

Yes, in general, write to /tmp all day long, just watch out for  
symbolic links to the base "ro" image.

For example if /tmp/foo linked to /stat/foo or /mnt/kd/foo then the  
write would go to CF.

A good example of this is the /var/lib/asterisk directory

# ls -l /var/lib/asterisk
lrwxrwxrwx    1 root     root           22 Jan 24 09:45 /var/lib/ 
asterisk -> /stat/var/lib/asterisk

While /var is mounted as tmpfs, the path "/var/lib/asterisk" points  
to the "ro" base image, which is overlaid with the "rw" unionfs CF  
partition.  So, writing to any file in or deeper in "/var/lib/ 
asterisk/" will be written to the unionfs CF overlay.

If you want to write data to CF, create a directory in the "/var/lib/ 
asterisk/" path and it will stored in the /stat/var/lib/asterisk/  
path. Which is actually stored in the /oldroot/mnt/asturw/stat/var/ 
lib/asterisk/ path on your /dev/hda2 partition.

Clear?

Lonnie


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Astlinux-users mailing list
Astlinux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/astlinux-users

Donations to support AstLinux are graciously accepted via PayPal to [EMAIL 
PROTECTED]

Reply via email to