Memory file system
Добавлено: 15 фев 2012, 16:33
gzip -d boot/mfsroot.gz
mdconfig -a -t vnode -f boot/mfsroot -u 9
mount /dev/md9 /mnt/tmp
cp install.cfg /mnt/tmp
umount /mnt/tmp
mdconfig -d -u 9
gzip boot/mfsroot
# mdconfig -a -s64m
md0
# newfs /dev/md0
/dev/md0: 64.0MB (131072 sectors) block size 16384, fragment size 2048
using 4 cylinder groups of 16.02MB, 1025 blks, 2112 inodes.
super-block backups (for fsck -b #) at:
160, 32960, 65760, 98560
# mount /dev/md0 /mnt && cd /mnt
# cp -R /etc /bin /sbin /lib /libexec .
# mkdir dev
# cat >etc/rc
#!/bin/sh
echo "Hello, world!"
exit 0
^D
# cd ..
# umount mnt
# gzip </dev/md0 >/boot/mfsroot.gz
# cat /boot/loader.conf
mfsroot_load="YES"
mfsroot_type="mfs_root"
mfsroot_name="/boot/mfsroot"
vfs.root.mountfrom="ufs:/dev/md0"
# shutdown -r now
mdconfig -a -t vnode -f boot/mfsroot -u 9
mount /dev/md9 /mnt/tmp
cp install.cfg /mnt/tmp
umount /mnt/tmp
mdconfig -d -u 9
gzip boot/mfsroot
# mdconfig -a -s64m
md0
# newfs /dev/md0
/dev/md0: 64.0MB (131072 sectors) block size 16384, fragment size 2048
using 4 cylinder groups of 16.02MB, 1025 blks, 2112 inodes.
super-block backups (for fsck -b #) at:
160, 32960, 65760, 98560
# mount /dev/md0 /mnt && cd /mnt
# cp -R /etc /bin /sbin /lib /libexec .
# mkdir dev
# cat >etc/rc
#!/bin/sh
echo "Hello, world!"
exit 0
^D
# cd ..
# umount mnt
# gzip </dev/md0 >/boot/mfsroot.gz
# cat /boot/loader.conf
mfsroot_load="YES"
mfsroot_type="mfs_root"
mfsroot_name="/boot/mfsroot"
vfs.root.mountfrom="ufs:/dev/md0"
# shutdown -r now