Class: Fstab::Lvm

Inherits:
Root
  • Object
show all
Defined in:
lib/fstab/lvm.rb

Instance Method Summary collapse

Methods inherited from Root

#generate

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) ⇒ Lvm

Returns a new instance of Lvm.



5
6
7
8
# File 'lib/fstab/lvm.rb', line 5

def initialize(devs, options)
  super
  @vg = options[:vg_name]
end

Instance Method Details

#write_homeObject



20
21
22
23
# File 'lib/fstab/lvm.rb', line 20

def write_home
  line = "/dev/#{@vg}/home /home #{@fs} rw,relatime 0 2"
  echo_a @conf, line
end

#write_rootObject



15
16
17
18
# File 'lib/fstab/lvm.rb', line 15

def write_root
  line = "/dev/#{@vg}/root / #{@fs} rw,relatime 0 1"
  echo_a @conf, line
end

#write_swapObject



10
11
12
13
# File 'lib/fstab/lvm.rb', line 10

def write_swap
  line = "/dev/#{@vg}/swap swap swap rw,noatime,discard 0 0"
  echo_a @conf, line
end