Linux:CentOS 7 Single User: Difference between revisions
Jump to navigation
Jump to search
(Created page with "How to startup single user rescue mode with lvm. Enter the grub boot menu and look for linux16 and change "ro" to "rw init=sysroot/bin/sh" then CTRL-X to start up You'll nee...") |
m (Nelgin moved page Category:Linux:CEntOS 7 Single User to Nigel's Wiki:Linux:CentOS 7 Single User without leaving a redirect: Put in the wrong place) |
(No difference)
|
Revision as of 06:43, 15 March 2018
How to startup single user rescue mode with lvm.
Enter the grub boot menu and look for linux16 and change "ro" to "rw init=sysroot/bin/sh" then CTRL-X to start up
You'll need to mount some filesystems
mount -t proc none /sysroot/proc mount -t sysfs none /sysroot/sys mount -o bind /dev /sysroot/dev
Now let's discover our LVMS if you have separate /var, /home, or other fs you want to work with
lvm vgscan -v lvm vgchange -a y lvm lvscan -v --all
After this I had to run vgscan again. I'm not sure it made the nodes the first time.
lvm vgscan -v --mknodes
Now you can mount any filesystems. This will vary with your vg names of course
mount /dev/vg00/lv.var /sysroot/var
Once you've got everything mounted you can chroot
chroot /sysroot
Remember to drop back out of sysroot and umount your filesystems before rebooting.
Hope this helps someone.