ZFS kasutamine operatsioonisüsteemiga Ubuntu 18.04
Allikas: Imre kasutab arvutit
Mine navigeerimisribaleMine otsikasti
Sissejuhatus
TODO
Tõõpõhimõte
TODO
- erinevalt mdadm raidist ei toimu taustal vaikimisi kord kuus mirrori lõhkumine ja uuesti ehitamine
Tarkvara paigaldamine
# apt-get install zfsutils-linux
Kasutamine
Pool tekitamine
# zpool create -o ashift=12 tank /dev/vdb
Tulemus
# zpool list NAME SIZE ALLOC FREE EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT tank 21.9G 468K 21.9G - 0% 0% 1.00x ONLINE -
taustal tekib kaks partitsiooni
# fdisk /dev/sdb -l Disk /dev/sdb: 1 TiB, 1099511627776 bytes, 2147483648 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 16384 bytes / 16777216 bytes Disklabel type: gpt Disk identifier: 459DC343-EA59-DC4F-AD3F-C2033AB84C2A Device Start End Sectors Size Type /dev/sdb1 2048 2147465215 2147463168 1024G Solaris /usr & Apple ZFS /dev/sdb9 2147465216 2147481599 16384 8M Solaris reserved 1
Suurendamine
# zpool set autoexpand=on tank
suurendada plokkseade ja öelda partprobe
# partprobe /dev/vdb
vaadata tulemust
# zpool status -v pool: tank state: ONLINE scan: none requested config: NAME STATE READ WRITE CKSUM tank ONLINE 0 0 0 vdb ONLINE 0 0 0 errors: No known data errors
Mountpoint määramine, nt
# zfs set mountpoint=/srv/vmail tank
NFS
Serveris
# zfs set sharenfs=on tank/imre-1
Kliendis
# mount 192.168.110.89:/srv/imre-yks /mnt # mount .. 192.168.110.89:/srv/imre-yks on /mnt type nfs4 (rw,relatime,vers=4.2,rsize=262144,wsize=262144,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=192.168.110.33,local_lock=none,addr=192.168.110.89)
Märkused
- systemctl zfs asjad
# systemctl | grep zfs ● zfs-import-cache.service loaded failed failed Import ZFS pools by cache file zfs-load-module.service loaded active exited Install ZFS kernel module zfs-mount.service loaded active exited Mount ZFS filesystems zfs-share.service loaded active exited ZFS file system shares zfs-zed.service loaded active running ZFS Event Daemon (zed) zfs-import.target loaded active active ZFS pool import target zfs.target loaded active active ZFS startup target
- peale 'zpool destory tank' ütlemist ja arvuti järgmist rebooti paistab selline olukord
root@portaal-to-maildir-1a:~# systemctl status zfs-import-cache.service ● zfs-import-cache.service - Import ZFS pools by cache file Loaded: loaded (/lib/systemd/system/zfs-import-cache.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Sat 2019-02-16 20:22:36 EET; 1min 8s ago Docs: man:zpool(8) Process: 572 ExecStart=/sbin/zpool import -c /etc/zfs/zpool.cache -aN (code=exited, status=1/FAILURE) Main PID: 572 (code=exited, status=1/FAILURE) Feb 16 20:22:34 portaal-to-maildir-1a systemd[1]: Starting Import ZFS pools by cache file... Feb 16 20:22:36 portaal-to-maildir-1a zpool[572]: cannot import 'tank': no such pool or dataset Feb 16 20:22:36 portaal-to-maildir-1a zpool[572]: Destroy and re-create the pool from Feb 16 20:22:36 portaal-to-maildir-1a zpool[572]: a backup source. Feb 16 20:22:36 portaal-to-maildir-1a systemd[1]: zfs-import-cache.service: Main process exited, code=exited, status=1/FAILURE Feb 16 20:22:36 portaal-to-maildir-1a systemd[1]: zfs-import-cache.service: Failed with result 'exit-code'. Feb 16 20:22:36 portaal-to-maildir-1a systemd[1]: Failed to start Import ZFS pools by cache file.
ZFS puhul on võimalus kasutada acl'i
TODO
ZFS ketaste tõstmine ühest arvutist teise
Väited
- võiks jälgida zfs versioone
# zpool upgrade -v This system supports ZFS pool feature flags. The following features are supported: FEAT DESCRIPTION ------------------------------------------------------------- async_destroy (read-only compatible) Destroy filesystems asynchronously. empty_bpobj (read-only compatible) ... The following legacy versions are also supported: VER DESCRIPTION --- -------------------------------------------------------- 1 Initial ZFS version 2 Ditto blocks (replicated metadata) ... 25 Improved scrub stats 26 Improved snapshot deletion performance 27 Improved snapshot creation performance 28 Multiple vdev replacements For more information on a particular version, including supported releases, see the ZFS Administration Guide.
Millised poolid on lisatud ketaste tõttu kasutatavad
# zpool import pool: sn_zfs_ssd id: 2639366720711406682 state: ONLINE status: The pool was last accessed by another system. action: The pool can be imported using its name or numeric identifier and the '-f' flag. see: http://zfsonlinux.org/msg/ZFS-8000-EY config: sn_zfs_ssd ONLINE sda ONLINE sdb ONLINE
Kasutusse võtmine
# zpool import -f sn_zfs_ssd # zpool list NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT sn_zfs_ssd 1.81T 988G 868G - - 23% 53% 1.00x ONLINE -
Monteerimine alternatiivsesse asukohta
# mkdir /mnt/bpool # zpool import -R /mnt/bpool bpool
Checkpoint kasutamine
TODO