Class: MountFs::Lvm

Inherits:
Minimal show all
Defined in:
lib/mountfs.rb

Instance Method Summary collapse

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

Returns a new instance of Lvm.



67
68
69
70
# File 'lib/mountfs.rb', line 67

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

Instance Method Details

#mount_homeObject



84
85
86
# File 'lib/mountfs.rb', line 84

def mount_home
  mount "/dev/#{@vg}/home", "#{@mountpoint}/home"
end

#mount_rootObject



72
73
74
# File 'lib/mountfs.rb', line 72

def mount_root
  mount "/dev/#{@vg}/root", @mountpoint
end

#mount_swapObject



76
77
78
79
80
81
82
# File 'lib/mountfs.rb', line 76

def mount_swap
  dm = Getch::Helpers.get_dm "#{@vg0}-swap"

  grep?('/proc/swaps', "/dev/#{dm}") && return

  swapon "/dev/#{@vg}/swap"
end