Class: Fstab::Zfs
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?, rm, search_proc_swaps, sed, sh, swapoff, swapoff_dm, touch, umount
Constructor Details
#initialize(devs, options) ⇒ Zfs
Returns a new instance of Zfs.
3 4 5 6 |
# File 'lib/fstab/zfs.rb', line 3 def initialize(devs, ) super @encrypt = [:encrypt] end |
Instance Method Details
#generate ⇒ Object
8 9 10 11 12 13 |
# File 'lib/fstab/zfs.rb', line 8 def generate @log.info 'Generating fstab...' write_efi write_swap @log.result_ok end |
#write_swap ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/fstab/zfs.rb', line 15 def write_swap uuid = gen_uuid @swap @encrypt ? line = "/dev/mapper/swap-luks none swap sw 0 0" : line = "UUID=#{uuid} swap swap rw,noatime,discard 0 0" echo_a @conf, line end |