Ryusuke Konishi wrote:

> 
> I've tried this without making sub directories:
> 
>  # mkdir /nilfs /snap-ro /snap-rw /change
>  # mount -t nilfs2 /dev/sdb1 /nilfs
>  ...
>  # mkcp -s
>  # lscp
>              CNO        DATE     TIME  MODE  SKT   NBLKINC       ICNT
>              ...
>            62305  2008-09-01 16:13:28  ss     -        488         39
>            62306  2008-09-01 16:13:33  cp     -          8         39
> 
>  # mount -t nilfs2 -o ro,cp=62305 /dev/sdb1 /snap-ro
>  # mount -t unionfs -o dirs=/snap-ro=rw unionfs /snap-rw
>  # unionctl /snap-rw --add --before /snap-ro --mode rw /change
>  <use /snap-rw as a writable snapshot mount>
> 
>  # mount
>  ...
>  /dev/sdb1 on /nilfs type nilfs2 (rw,gcpid=9512)
>  /dev/sdb1 on /snap-ro type nilfs2 (ro,cp=62305)
>  unionfs on /snap-rw type unionfs (rw,dirs=/snap-ro=rw)
> 
> It's working fine.
> Is there a quicker way?  (Or something to add?)

well, with new unionfs, you wouldn't use unionctl, but what I did was 
close, but something more along the lines of

- to setup

mkdir /base /nilfs /snap-ro /union
mount -t ext3 /dev/sdb1 /base
mount -t nilfs2 /dev/sdb2 /nilfs

mkdir /nilfs/1

mount -t unionfs -o dirs=/nilfs/1=rw,/base=ro none /union
(use union), all writes go to nilfs

- to rollback to a checkpoint, but keep it writable.

mount -t nilfs2 -o ro,cp=xyz /dev/sdb1 /snap-ro
mkdir /nilfs/2
mount -t unionfs -o dirs=/nilfs/2=rw,/nilfs/1=ro,/base=ro none /union

i.e. chaining the /nilfs/* dirs together with unionfs.
_______________________________________________
users mailing list
[email protected]
https://www.nilfs.org/mailman/listinfo/users

Reply via email to