Hetzner/zfs

если amd64 сборка, то ставь zfs, только сразу лучше FreeBSD 8.2-STABLE, там v28 zfs

Вопрос: а в двух словах - чего мне даст zfs + это совсем другая философия работы с данными нет fsck скорость работы особенно snapshot'ы и т.д.

ls -alhFoG /nfs/mfsbsd/ total 1709580  drwxr-xr-x  2 root  wheel  -  4.0K Mar 10 09:04 ./ drwxr-xr-x 10 root  wheel  -  4.0K Mar 11 07:56 ../ -rw-r--r--  1 root  wheel  -  143M Jun 28  2010 7.3-release-amd64.tbz -rw-r--r--  1 root  wheel  -  126M Jun 28  2010 7.3-release-i386.tbz -rw-r--r--  1 root  wheel  -  104M Mar 10 08:23 7.4-release-amd64.tbz -rw-r--r--  1 root  wheel  -   93M Mar 10 09:04 7.4-release-i386.tbz -rw-r--r--  1 root  wheel  -  176M Jun 28  2010 8.0-release-amd64.tbz -rw-r--r--  1 root  wheel  -  157M Jun 28  2010 8.0-release-i386.tbz -r--r--r--  1 root  wheel  -   93M Mar  5  2010 8.0p2-amd64-v3.tbz -r--r--r--  1 root  wheel  -   93M Apr 23  2010 8.0p2-amd64-v4.tbz -r--r--r--  1 root  wheel  -   66M Jul 26  2010 8.1-amd64-zfs.tar.xz -r--r--r--   1 root  wheel  -   96M Jul 26  2010 8.1-amd64-zfs.tbz -rw-r--r--  1 root  wheel  -  118M Aug 24  2010 8.1-release-amd64.tbz -rw-r--r--  1 root  wheel  -  105M Aug 24  2010 8.1-release-i386.tbz -r--r--r--  1 root  wheel  -   77M Mar 10 07:31 8.2-amd64-zfs.tar.xz -rw-r--r--   1 root  wheel  -  118M Mar  4 15:19 8.2-release-amd64.tbz -rw-r--r--  1 root  wheel  -  103M Mar  4 14:46 8.2-release-i386.tbz 

atacontrol list  ATA channel 2: Master: ad4  SATA revision 2.x ATA channel 3: Master: ad6  SATA revision 2.x 

zfsinstall -d ad4 -d ad6 -t /nfs/mfsbsd/8.2-amd64-zfs.tar.xz -s 4G  Notice: two drives selected, automatically choosing mirror mode Error: /dev/ad4 already contains a partition table. =>       63  1465149105  ad4  MBR  (699G) 63 1465149105       - free -  (699G) You may erase the partition table manually with the destroygeom command  destroygeom -d ad4 destroygeom -d ad6

zfsinstall -d ad4 -d ad6 -t /nfs/mfsbsd/8.2-amd64-zfs.tar.xz -s 4G  Notice: two drives selected, automatically choosing mirror mode Creating GUID partitions on ad4 ... done Configuring ZFS bootcode on ad4 ... done =>       34  1465149101  ad4  GPT  (699G) 34        128    1  freebsd-boot  (64K) 162    8388608    2  freebsd-swap  (4.0G) 8388770 1456760365    3  freebsd-zfs  (695G)

Creating GUID partitions on ad6 ... done Configuring ZFS bootcode on ad6 ... done =>       34  1465149101  ad6  GPT  (699G) 34        128    1  freebsd-boot  (64K) 162    8388608    2  freebsd-swap  (4.0G) 8388770 1456760365    3  freebsd-zfs  (695G)

Creating ZFS pool tank on ad4p3 ad6p3 ... done Creating tank root partition: ... done Creating tank partitions: var tmp ... done Setting bootfs for tank to tank/root ... done NAME           USED  AVAIL  REFER  MOUNTPOINT tank           180K   681G    21K  none tank/root       66K   681G    24K  /mnt tank/root/tmp   21K   681G    21K  /mnt/tmp tank/root/var   21K   681G    21K  /mnt/var Extracting FreeBSD distribution ... done Writing /boot/loader.conf... done Writing /etc/fstab...Writing /etc/rc.conf... done Copying /boot/zfs/zpool.cache ... done

Installation complete. The system will boot from ZFS with clean install on next reboot

You may type "chroot /mnt" and make any adjustments you need. For example, change the root password or edit/create /etc/rc.conf for for system services.

WARNING - Don't export ZFS pool "tank"! zfsinstall -d ad4 -d ad6 -t /nfs/mfsbsd/8.2-amd64-zfs.tar.xz -s 4G Notice: two drives selected, automatically choosing mirror mode Creating GUID partitions on ad4 ... done Configuring ZFS bootcode on ad4 ... done =>       34  1465149101  ad4  GPT  (699G) 34        128    1  freebsd-boot  (64K) 162    8388608    2  freebsd-swap  (4.0G) 8388770 1456760365    3  freebsd-zfs  (695G)

Creating GUID partitions on ad6 ... done Configuring ZFS bootcode on ad6 ... done =>       34  1465149101  ad6  GPT  (699G) 34        128    1  freebsd-boot  (64K) 162    8388608    2  freebsd-swap  (4.0G) 8388770 1456760365    3  freebsd-zfs  (695G)

Creating ZFS pool tank on ad4p3 ad6p3 ... done Creating tank root partition: ... done Creating tank partitions: var tmp ... done Setting bootfs for tank to tank/root ... done NAME           USED  AVAIL  REFER  MOUNTPOINT tank           180K   681G    21K  none tank/root       66K   681G    24K  /mnt tank/root/tmp   21K   681G    21K  /mnt/tmp tank/root/var   21K   681G    21K  /mnt/var Extracting FreeBSD distribution ... done Writing /boot/loader.conf... done Writing /etc/fstab...Writing /etc/rc.conf... done Copying /boot/zfs/zpool.cache ... done

Installation complete. The system will boot from ZFS with clean install on next reboot

You may type "chroot /mnt" and make any adjustments you need. For example, change the root password or edit/create /etc/rc.conf for for system services.

WARNING - Don't export ZFS pool "tank"! 

bsdconfig Welcome to the Hetzner configuration tool for FreeBSD.

Hostname: master.aopa.ru

Changing local password for root New Password: Retype New Password:

Configuring rc.conf... DONE Configuring loader.conf... DONE DONE Enabling SSH login for root... DONE Configuring resolv.conf... DONE

Congratulations! The configuration has been completed successfully. You can now use 'reboot' to boot your newly installed FreeBSD system.

PermitRootLogin yes добавляют сами

mount  tank/root on / (zfs, local) devfs on /dev (devfs, local, multilabel) tank/root/tmp on /tmp (zfs, local) tank/root/var on /var (zfs, local) master# df -h Filesystem      Size    Used   Avail Capacity  Mounted on tank/root        681G    334M    681G     0%    / devfs           1.0K    1.0K      0B   100%    /dev tank/root/tmp   681G     26K    681G     0%    /tmp tank/root/var   681G    182K    681G     0%    /var

uname -a FreeBSD master.aopa.ru 8.2-RELEASE FreeBSD 8.2-RELEASE #0 r219081M: Wed Mar 2 08:29:52 CET 2011     root@www4:/usr/obj/usr/src/s

cat /etc/fstab /dev/gptid/24ecb7d1-b6c5-11e0-8d5d-6c626d457421 none swap sw 0 0

chroot /mnt chroot: /usr/local/bin/bash: No such file or directory [root@rescue ~]# echo $SHELL /usr/local/bin/bash [root@rescue ~]# export SHELL=/bin/csh [root@rescue ~]# echo $SHELL /bin/csh [root@rescue ~]# chroot /mnt

cat /boot/loader.conf zfs_load="YES" vfs.root.mountfrom="zfs:tank/root" geom_mirror_load="YES"

Последнюю надо убрать. Она тут не требуется.

Ссылки

 * Установка gmirror http://esetnod.gs/2010/07/23/ustanovka-freebsd-iz-rescue-system-v-hetzner/
 * http://mfsbsd.vx.sk/