Fstab::Entry
The Kanrisuru::Remote::Fstab::Entry
class helps manages an invidual entry for the fstab. This is mostly used to parse a single entry from a list of entries in a fstab file, but can also be used to make changes or create new entries for the fstab.
Attributes
- [R] device, uuid, invalid, label, type, opts, freq, passno
- [RW] mount_point
Public Class Methods
new
Instantiates a new instace of the entry class. Requires a host instance, and then either a text version of a fstab entry line, or a hash of options.
## Instantiate by line
entry = Kanrisuru::Remote::Fstab::Entry.new(
host: host,
line: 'UUID=6cd50e51-cfc6-40b9-9ec5-f32fa2e4ff03 / xfs defaults 0 0'
)
entry.type
'xfs'
entry.uuid
'6cd50e51-cfc6-40b9-9ec5-f32fa2e4ff03'
## Instantiate by options
entry = Kanrisuru::Remote::Fstab::Entry.new(
host: host,
device: '/dev/vda9',
mount_point: '/mnt/dir1',
type: 'ext4',
freq: 0,
passno: 0,
opts: {
defaults: true,
async: true
}
)
entry.to_s
"/dev/vda9 /mnt/dir1 ext4 defaults,async 0 0"
Public Instance Methods
to_s
Output the string representation of the fstab entry.
valid?
Returns true if the instantiated fstab entry was suscessfuly parsed from the line or options params.