LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to recover the root password in opensuse. (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-recover-the-root-password-in-opensuse-698291/)

chandramani_yadav 01-19-2009 04:09 AM

How to recover the root password in opensuse.
 
Follow the below given steps to recover the opensuse root password

1. boot the system with any livecd
2. suppose you have the following partition structure
sda1 /boot
sda2 /
sda3 swap
sda4 extended
sda5 systemvg ( volume group containing physical volume --- LVM)
usrlv /usr
optlv /opt
varlv /var
tmplv /tmp


3. mount the partions as given below

mount /dev/sda2 /mnt
mount /dev/sda1 /mnt/boot
swapon /dev/sda3
vgchange -ay
mount /dev/systemvg/usrlv /mnt/usr
mount /dev/systemvg/optlv /mnt/opt
mount /dev/systemvg/varlv /mnt/var
mount /dev/systemvg/tmplv /mnt/tmp

mount -o bind /dev /mnt/dev
mount -t proc none /mnt/proc

chroot /mnt /bin/bash


4. now change the root password as mentioned below

passwd root

chandramani_yadav 01-19-2009 04:12 AM

How to Recover the Root password in opensuse
 
If there is some problem while doing the chroot then do the following

Umount /mnt/dev
umount /mnt/proc

And run the following command
mount -o bind /proc /mnt/proc
mount -o bind /sys /mnt/sys
mount -o bind /dev /mnt/dev


All times are GMT -5. The time now is 04:35 PM.