V
4  
Tags
There are no tags for this page.
Attachments
Dobrica Pavlinušić's random unstructured stuff
ZFS


ZFS

MySQL

cache only metadata for Innodb

zfs set primarycache=metadata tank/db

match recordsize to block size

before creating database

zfs set recordsize=16k tank/db

root filesystem on zfs

based on https://github.com/zfsonlinux/zfs/wiki/HOWTO-install-Debian-GNU-Linux-to-a-Native-ZFS-Root-Filesystem

root@lib10:~# apt-get install zfs-initramfs

root@lib10:~# zfs create -o mountpoint=none lib10/ROOT

root@lib10:~# zfs create -o mountpoint=/ lib10/ROOT/debian-1
cannot mount '/': directory is not empty
filesystem successfully created, but not mounted

root@lib10:~# zpool set bootfs=lib10/ROOT/debian-1 lib10

root@lib10:~# mkdir /tmp/root
root@lib10:~# mount --bind / /tmp/root/

root@lib10:~# mkdir /tmp/zfs-root
root@lib10:~# zfs set mountpoint=/tmp/zfs-root lib10/ROOT/debian-1
root@lib10:~# zfs mount lib10/ROOT/debian-1
root@lib10:~# zfs set compression=lz4 lib10/ROOT
root@lib10:~# rsync -ravH --numeric-ids /tmp/root/ /tmp/zfs-root/

# duh, source btrfs had snapshot on it

root@lib10:~# rsync -ravH --numeric-ids --exclude '/.snapshot' --exclude '/tmp' --delete /tmp/root/ /tmp/zfs-root/

root@lib10:~# zfs umount lib10/ROOT/debian-1

root@lib10:~# cd /tmp/zfs-root/

root@lib10:~# cd /tmp/zfs-root/
root@lib10:/tmp/zfs-root# mount --bind /dev dev/
root@lib10:/tmp/zfs-root# mount --bind /sys sys/
root@lib10:/tmp/zfs-root# mount --bind /proc/ proc/
root@lib10:/tmp/zfs-root# chroot .
root@lib10:/# 

root@lib10:~# df
Filesystem          1K-blocks    Used Available Use% Mounted on
lib10/ROOT/debian-1 195788544 1149184 194639360   1% /
udev                 10270376       0  10270376   0% /dev
root@lib10:~# mount /boot/
root@lib10:~# df
Filesystem          1K-blocks    Used Available Use% Mounted on
lib10/ROOT/debian-1 195787904 1149184 194638720   1% /
udev                 10270376       0  10270376   0% /dev
/dev/sdg1              198337   62072    136265  32% /boot

root@lib10:~# grep zfs /etc/default/grub 
GRUB_CMDLINE_LINUX_DEFAULT="boot=zfs rpool=lib10 bootfs=lib10/ROOT/debian-1"

root@lib10:~# update-grub

root@lib10:~# grep zfs /boot/grub/grub.cfg 
insmod zfs
        linux   /vmlinuz-4.8.0-2-amd64 root=ZFS=lib10/ROOT/debian-1 ro  boot=zfs rpool=lib10 bootfs=lib10/ROOT/debian-1
                linux   /vmlinuz-4.8.0-2-amd64 root=ZFS=lib10/ROOT/debian-1 ro  boot=zfs rpool=lib10 bootfs=lib10/ROOT/debian-1
                linux   /vmlinuz-4.8.0-1-amd64 root=ZFS=lib10/ROOT/debian-1 ro  boot=zfs rpool=lib10 bootfs=lib10/ROOT/debian-1


root@lib10:~# update-initramfs -v -k all -u

root@lib10:~# umount /boot/
root@lib10:~# exit


root@lib10:~# umount /tmp/zfs-root/dev/
root@lib10:~# umount /tmp/zfs-root/proc/
root@lib10:~# umount /tmp/zfs-root/sys/

root@lib10:~# zfs umount lib10/ROOT/debian-1

root@lib10:~# zfs set mountpoint=/ lib10/ROOT/debian-1




 

Upload Files

Click "Browse" to find the file you want to upload. When you click "Upload file" your file will be uploaded and added to the list of attachments for this page.

Maximum file size: 50MB

 
 
 
File Name Author Date Uploaded Size

Save Page As

Enter a meaningful and distinctive title for your page.

Page Title:

Tip: You'll be able to find this page later by using the title you choose.

Page Already Exists

There is already a page named XXX. Would you like to:

Save with a different name:

Save the page with the name "XXX"

Append your text to the bottom of the existing page named: "XXX"

Upload Files

Click "Browse" to find the file you want to upload. When you click "Add file" this file will be added to the list of attachments for this page, and uploaded when you save the page.

 
 
 
Add Tags

Enter a tag and click "Add tag". The tag will be saved when you save the page.

Tag: 

Suggestions: