shithub: wiki.9front.org

ref: 45f6dd9f8e21e2e8d6b185d39b2f36098e62b286
dir: /cwfs.md/

View raw version
cwfs(4) tips
============

Adding A drive to the worm
--------------------------

On long living installations or ones that hold a lot of larger files
you may want to add a drive to WORM when it starts to fill up.

First, format the disk, if you are adding to a current install
you probably want one large `plan9` partition containing a single `fsworm`
partition:

	disk/mbr -m /386/mbr /dev/sdD0/data # If your using gpt I can't help you here
	disk/fdisk -a /dev/sdD0/data # disk/edisk for gpt
	# this will partition all unpartitioned space as a plan9 partition,
	# if it looks correct type w to save and then q to quit
	disk/prep -a fsworm /dev/sdD0/plan9
	# this will create an fsworm partition w and q if it looks correct

Now reboot the computer and at bootargs start cwfs with -c to enter
configuration console. At the console enter a new configuration which
includes the newly created `fsworm` partition.
Note that device names are likely to be different in your case.

	config: filsys main c(/dev/sdC0/fscache)((/dev/sdC0/fsworm)(/dev/sdD0/fsworm))
	config: filsys dump o
	config: end

After exiting the console the system should boot with the new partition
added to the WORM. Run:

	con -C /srv/cwfs.cmd
	statw

to confirm. `wsize * 16000` is the size of your WORM.

No refunds

CWFS with WORM on a separate drive
----------------------------------

### What you do is what you get

These instructions assume you want to set up CWFS on two drives - one
containing the cache filesystem, and the other containing the WORM.

This process has been tested on MBR installations, but should be
extrapolable to GPT as well with minor changes (see end note if using
GPT, please report the results).

### Initialize the disks

For this example `sd00` will be the cache drive, `sd01` will be the
WORM.

Assuming your drives are new, for a MBR partitioning scheme, you want
to first create a MBR partition table (skip in case of GPT):

	disk/mbr -a /386/mbr /dev/sd00/data 
	disk/mbr -a /386/mbr /dev/sd01/data

You need to add a `plan9` partition to both disks, otherwise the
installer will not see them (use `disk/edisk` in case of GPT):

	disk/fdisk -baw /dev/sd00/data disk/fdisk -baw /dev/sd01/data

Now it is time to subdivide the plan9 partitions on both disks.  We
will then subpartition the cache, and worm disks:

	disk/prep -bw -a^(9fat nvram other fscache) /dev/sd00/plan9
	disk/prep -bw -a fsworm /dev/sd01/plan9

### Finally

Start your installation as usual: select `cwfs64x` as your filesystem,
skip partdisk and prepdisk.  When going through the `mountfs` step,
make sure to point to the right partitions on each function.

More tips
---------

[Create an encrypted bootable backup to an external USB drive](https://9lab.org/plan9/backup-to-external-usb-drive/)