Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision |
howtos:zfs_home [2020/09/02 03:20 (UTC)] – improvements dchmelik | howtos:zfs_home [2024/02/12 13:48 (UTC)] – dchmelik |
---|
Of course, Xen (a hypervisor virtual machine) is another excellent option for multiple native-on-hardware OS, including Unix, but you might just have to copy between fs and not all OS write well... so you could even try Xen with ZFS storage...) | Of course, Xen (a hypervisor virtual machine) is another excellent option for multiple native-on-hardware OS, including Unix, but you might just have to copy between fs and not all OS write well... so you could even try Xen with ZFS storage...) |
| |
===== Always Backup /home Regularly===== | ===== Always Backup /home Regularly. Make the ZFS package===== |
| |
Here's how you can prepare to create a ZFS /home. | Here's how you can prepare to create a ZFS /home. |
| |
===== Research/read At Least A Little ===== | ===== Research/read At Least A Little ===== |
Before first actual ZFS commands, you may want to view /usr/doc/zfs-on-linux-* , cat or more (or less, most) /var/log/packages/zfs-on-linux-* , ‘man zpool,’ ‘man zfs.’ A zpool holds and manages one or more zfs and has many options, which for advanced/large storage, you will want some/all (maybe depending on compatibility with other systems accessing)... that case would be for new sections or advanced storage HOWTO... here it's assumed one may not use most/any extra options because might not be a data-centre (but one feature will be mentioned) rather than wanting to share /home with a Unix, which many may not have all options (as OpenSolaris' ZFS and zfs-on-linux are slightly different--at different stages of overall ZFS design, so some versions have things older ones don't, and won't even be readable with... you should check/view those project sites (linked here sooner or later,) even though zfs-on-linux people didn't bother to address the most long-time/influential GNU/Linux--Slackware--some/many command/option examples for others--even if not Unix-like--will be similar/same.) | Before first actual ZFS commands, you may want to view /usr/doc/zfs-on-linux-* , cat or more (or less, most) /var/log/packages/zfs-on-linux-* , ‘man zpool,’ ‘man zfs.’ A zpool holds and manages one or more zfs and has many options, which for advanced/large storage, you will want some/all (maybe depending on compatibility with other systems accessing)... that case would be for new sections or advanced storage HOWTO... here it's assumed one may not use most/any extra options because might not be a data-centre (but one feature will be mentioned) rather than wanting to share /home with a Unix, which many may not have all options (as OpenSolaris/IllumOS' ZFS and zfs-on-linux are slightly different--at different stages of overall ZFS design, so some versions have things older ones don't, and won't even be readable with... you should check/view those project sites (linked here sooner or later,) even though zfs-on-linux people didn't bother to address the most long-time/influential GNU/Linux--Slackware--some/many command/option examples for others--even if not Unix-like--will be similar/same.) |
| |
===== Create & Start ZFS ===== | ===== Create & Start ZFS ===== |
Once you installed ZFS and all various /home files are backed up, start ZFS with rc script (run it or reboot)... login root (or su -) or use sudo for those commands below. Remember, this will be with no extra options (-d option is ‘no options’ unless specified) other than use a ‘modern’ sector size (unless you have a drive so old it should probably be replaced if even still working, this size should be reasonable)... ‘-o ashift=12’ option creates 2<sup>12</sup>, i.e., 4KB sectors (you shouldn't actually use larger/8KB unless using //older// solid state drive, SSD designed 8KB.) You can read zpool & zfs manpages to find/add more options. If you do and share a /home, install ZFS on both OSes, dump zpool option list sets on each to see what's usable (only the [[http://mathworld.wolfram.com/Intersection.html|set intersection]].) Most likely both will have compression and snapshots, so if you want those, read examples/manpages. | Once you installed ZFS and all various /home files are backed up, start ZFS with rc script (run it or reboot)... login root (or su -) or use sudo for those commands below. Remember, this will be with no extra options (-d option is ‘no options’ unless specified) other than use a ‘modern’ sector size (unless you have a drive so old it should probably be replaced if even still working, this size should be reasonable)... ‘-o ashift=12’ option creates 2<sup>12</sup>, i.e., 4KB sectors (you shouldn't actually use larger/8KB unless using //older// solid state drive, SSD designed 8KB.) You can read zpool & zfs manpages to find/add more options. If you do and share a /home, install ZFS on both OSes, dump zpool option list sets on each to see what's usable (only the [[http://mathworld.wolfram.com/Intersection.html|set intersection]].) Most likely both will have compression and snapshots, so if you want those, read examples/manpages. |
| |
Below is to create a ZFS drive (replace L with drive block device letter,number you want.) | Below is to create a ZFS drive (replace L with drive block device letter you want.) |
<code>zpool create -d -o ashift=12 home /dev/sdL</code> | <code>zpool create -d -o ashift=12 home /dev/sdL</code> |
| |
//Alternatively//, if //not using an entire drive//, below is to create a ZFS partition (replace L,N with drive partition block device letter,number you want.) | //Alternatively//, if //not using an entire drive// (but normally a Solaris GPT partition) below is to create a ZFS partition (replace L,N with drive partition block device letter,number you want.) |
<code>zpool create -d -o ashift=12 home /dev/sdLN</code> | <code>zpool create -d -o ashift=12 home /dev/sdLN</code> |
| |
If you don't need access time (atime) logged for files, disable atime to speed up ZFS. | If you don't need access time (atime) logged for files, disable atime to speed up ZFS. |
| |
<code>#zfs set atime=off home</code> | <code>zfs set atime=off home</code> |
| |
===== How to Stop ZFS ====== | ===== How to Stop ZFS ====== |