Class: Fstab::Zfs
Overview
Generating fstab for zfs filesystem
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(devs, options) ⇒ Zfs
constructor
A new instance of Zfs.
- #write_swap ⇒ Object
Methods included from NiTo
cp, echo, echo_a, grep?, mkdir, mount, mount?, mv, rm, search_proc_swaps, sed, sh, swapoff, swapoff_dm, touch, umount
Constructor Details
#initialize(devs, options) ⇒ Zfs
Returns a new instance of Zfs.
6 7 8 9 |
# File 'lib/fstab/zfs.rb', line 6 def initialize(devs, ) super @encrypt = [:encrypt] end |
Instance Method Details
#generate ⇒ Object
11 12 13 14 15 16 |
# File 'lib/fstab/zfs.rb', line 11 def generate @log.info 'Generating fstab...' write_efi write_swap @log.result_ok end |
#write_swap ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/fstab/zfs.rb', line 18 def write_swap uuid = gen_uuid @swap line = if @encrypt '/dev/mapper/swap-luks none swap sw 0 0' else "UUID=#{uuid} swap swap rw,noatime,discard 0 0" end echo_a @conf, line end |