Environment
- Red Hat Enterprise Linux 7
Issue
- I would like to mount a non root filesystem early in the boot process
Resolution
- Create
/etc/fstab.sys
# vi /etc/fstab.sys
UUID="71be1001-d764-4505-a225-30d4771833f5" /mnt/test xfs defaults 0 0
fstab.sys
uses the same syntax style as /etc/fstab
- Rebuild
initramfs
# dracut -f
- Reboot
# reboot
Root Cause
The
dracut fstab-sys
module allows the ability to load a seperate fstab
into the initramfs which can allow the ability to load a file system earlier in the boot process./usr/lib/dracut/modules.d/95fstab-sys/module-setup.sh
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
check() {
test -f /etc/fstab.sys || [[ -n $add_fstab || -n $fstab_lines ]]
}
depends() {
echo fs-lib
}
install() {
[ -f /etc/fstab.sys ] && inst_simple /etc/fstab.sys
inst_hook pre-pivot 00 "$moddir/mount-sys.sh"
}
Comments
Post a Comment