Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zfs rescue /etc #5192

Closed
wamba2016 opened this issue Sep 29, 2016 · 2 comments
Closed

zfs rescue /etc #5192

wamba2016 opened this issue Sep 29, 2016 · 2 comments

Comments

@wamba2016
Copy link

Hi,
my server boot on zfs.
Recently i change some pam.d file ( common-auth, common-password...) after that i can not use my ubuntu os.
I try to rescue with xubuntu live cd, and using zfs mount -a to rebuild my dataset zpool, but i can not find the original /etc folder
I see all other dataset bunt not /etc/pam.d

Please help

@deajan
Copy link

deajan commented Sep 30, 2016

This is probably more a question for an ubuntu forum than here. You might also ask this on zfs discussion list.
Consider closing this issue as it's not directly developpment related.

@rlaager
Copy link
Member

rlaager commented Oct 4, 2016

You installed Ubuntu on a ZFS root using some variant of the official HOWTO (or my fork before it was merged), right? https://github.com/zfsonlinux/zfs/wiki/Ubuntu-16.04-Root-on-ZFS

zfs mount -a will not mount the root dataset, as it has canmount=noauto set. This is done because there may be multiple clones (in the future, if you were using something like beadm).

Here's what you want in the Live CD (where rpool is the name of your pool):
apt install zfsutils-linux
zpool import -N -R /mnt rpool
zfs mount rpool/ROOT/ubuntu
zfs mount -a

Then, your whole system should be accessible at /mnt. You can fix the file from the Live CD environment.

If you need to chroot into your environment, do this:
mount --rbind /dev /mnt/dev
mount --rbind /proc /mnt/proc
mount --rbind /sys /mnt/sys
chroot /mnt /bin/bash --login

@rlaager rlaager closed this as completed Oct 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants