Note
The Funtoo Linux project has transitioned to "Hobby Mode" and this wiki is now read-only.
Difference between revisions of "User:Cuantar"
Jump to navigation
Jump to search
(add unlocking script for lvm rootfs) |
m (move --rbinds to filesystem mount function) |
||
Line 24: | Line 24: | ||
mount /dev/${volgroup}/var_git /mnt/funtoo/var/git/ | mount /dev/${volgroup}/var_git /mnt/funtoo/var/git/ | ||
swapon /dev/${volgroup}/swap | swapon /dev/${volgroup}/swap | ||
mount --rbind /dev /mnt/funtoo/dev/ | |||
mount --rbind /proc /mnt/funtoo/proc/ | |||
mount --rbind /sys /mnt/funtoo/sys/ | |||
} | } | ||
enter_chroot() { | enter_chroot() { | ||
chroot /mnt/funtoo /bin/bash | chroot /mnt/funtoo /bin/bash | ||
} | } |
Latest revision as of 21:11, February 17, 2024
Useful bits
It's often handy to be able to open a system quickly from a rescue disk. I use a script like the following:
/root/unlock.sh
(bash source code) - script to open a Funtoo rootfs#!/bin/bash
mount_filesystems() {
mkdir /mnt/funtoo -p
mount /dev/${volgroup}/root /mnt/funtoo
mkdir /mnt/funtoo/{usr,var,tmp,opt,boot} -p
mount /dev/${volgroup}/boot /mnt/funtoo/boot
mount /dev/${volgroup}/usr /mnt/funtoo/usr
mount /dev/${volgroup}/var /mnt/funtoo/var
mount /dev/${volgroup}/opt /mnt/funtoo/opt
mount /dev/${volgroup}/tmp /mnt/funtoo/tmp
mkdir /mnt/funtoo/var/{git,tmp,cache/portage} -p
mount /dev/${volgroup}/var_tmp /mnt/funtoo/var/tmp/
mount /dev/${volgroup}/var_cache /mnt/funtoo/var/cache/
mount /dev/${volgroup}/var_git /mnt/funtoo/var/git/
swapon /dev/${volgroup}/swap
mount --rbind /dev /mnt/funtoo/dev/
mount --rbind /proc /mnt/funtoo/proc/
mount --rbind /sys /mnt/funtoo/sys/
}
enter_chroot() {
chroot /mnt/funtoo /bin/bash
}
main() {
mount_filesystems
enter_chroot
}
volgroup='v0' main
To use it yourself, change the volgroup
variable to match your volume group and adjust the paths to agree with your fstab
.