Let’s see how to use NetBSD’s newborn volume manager. It’s sharing much with Linux LVM, so it may be very familiar. You will need NetBSD current (I’m using 5.99.10) and sources.
# cd /usr/src/external/gpl2/lvm2/
# USETOOLS=no MKLVM=yes make
# USETOOLS=no MKLVM=yes make install
# USETOOLS=no MKLVM=yes make clean
# cd /usr/src/sys/modules/dm/
# USETOOLS=no MKLVM=yes make
# USETOOLS=no MKLVM=yes make install
# USETOOLS=no MKLVM=yes make clean
Let’s load it:
# modload dm
# modstat | grep dm
dm driver filesys 0 18364 -
# lvm pvcreate /dev/rwd1d /dev/rwd2d
Physical volume "/dev/rwd1d" successfully created
Physical volume "/dev/rwd2d" successfully created
# lvm vgcreate volumes /dev/rwd1d /dev/rwd2d
Volume group "volumes" successfully created
# lvm lvcreate -n vol0 -L 400M volumes
Logical volume "vol0" created
# lvm lvs
LV VG Attr LSize Origin Snap% Move Log Copy% Convert
vol0 volumes -wi-a- 400.00M
# newfs -O 2 -F -s 400M /dev/volumes/rvol0
/dev/volumes/rvol0: 400.0MB (819200 sectors) block size 8192, fragment size 1024
using 9 cylinder groups of 44.45MB, 5689 blks, 10720 inodes.
super-block backups (for fsck_ffs -b #) at:
144, 91168, 182192, 273216, 364240, 455264, 546288, 637312, 728336,
# mount /dev/volumes/vol0 /mnt
# mount
/dev/wd0a on / type ffs (log, local)
kernfs on /kern type kernfs (local)
ptyfs on /dev/pts type ptyfs (local)
procfs on /proc type procfs (local)
/dev/mapper/volumes-vol0 on /mnt type ffs (local)
