View previous topic :: View next topic |
Author |
Message |
auddoula Guru
Joined: 30 Apr 2008 Posts: 387
|
Posted: Wed Sep 11, 2013 10:56 pm Post subject: Broken system: no root account, read only user account |
|
|
Hi Everyone,
I am relatively green in administrating a Gentoo system. For various reasons I was not able to update my system for over a year, then I tried update the world, but in the process I must have deleted some crucial programs. Just now, we had a power outage due to a storm, and when I rebooted I am taken to a screen with login name with the message 'This is (none).unknown_domain.
I can't login as a root, and as a user I get only 'read-only' privilege (Uanable to change owner or mode of tty stdin). i can see all my data files which I cannot afford to lose.
More info to help you help me:
running x86_64 2.6.34-gentoo-r6
When I reboot, things bail out right after 'Activating mdev'
In the grub menu:
root(hd0,0)
kernel /kernel-genkernel... root=dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/sda2
[When I try to edit this line w 'e', and then tab to see options, I get an error 'Unrecognized device string']
I think I messed up the system big time, not sure how to recover it. I would rater avoid rebuilding the system if possible, but I must keep my personal data files.
I am not sure if I gave you enough intelligent details, but I am willing to work with anyone if you guide me through the process. Thanks in advance for your help. |
|
Back to top |
|
|
Jaglover Watchman
Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
Posted: Wed Sep 11, 2013 11:11 pm Post subject: |
|
|
Personal files you cannot lose ... you will lose them in case of hard drive failure, so better back them up _now_.
Then run dispatch-conf (or etc-update) to make sure your conf is consistent with the state of your system. If you still have problems logging in post back. _________________ My Gentoo installation notes.
Please learn how to denote units correctly! |
|
Back to top |
|
|
DONAHUE Watchman
Joined: 09 Dec 2006 Posts: 7651 Location: Goose Creek SC
|
Posted: Wed Sep 11, 2013 11:22 pm Post subject: |
|
|
Assuming you did not keep a backup ...
create a system rescue cd or system rescue usb flash , boot it to the xfce4 GUI and network connection, in the terminal, fsck your gentoo parttitions, nominally: Code: |
fsck /dev/sda1
fsck /dev/sda3 | assuming that works; mount your gentoo partitions and enter the chroot: nominally: Code: | mount /dev/sda3 /mnt/gentoo
mount /dev/sda1 /mnt/gentoo/boot
mount -t proc none /mnt/gentoo/proc
mount --rbind /sys /mnt/gentoo/sys
mount --rbind /dev /mnt/gentoo/dev
chroot /mnt/gentoo /bin/bash
source /etc/profile
export PS1="(chroot) $PS1" | backup /root and /home to an external hard drive or flash dive or another internal hard drive.
post your status here, gentoo hopefully is running in the chroot in thr terminal
outside the terminal you can use the midori browser provided in the xfce GUI _________________ Defund the FCC. |
|
Back to top |
|
|
auddoula Guru
Joined: 30 Apr 2008 Posts: 387
|
Posted: Wed Sep 11, 2013 11:24 pm Post subject: |
|
|
Jaglover wrote: | Personal files you cannot lose ... you will lose them in case of hard drive failure, so better back them up _now_.
|
right, I have an external USB drive. How can I back up when I cannot even see USB drive. On top of everything I do not have any write permission. |
|
Back to top |
|
|
DONAHUE Watchman
Joined: 09 Dec 2006 Posts: 7651 Location: Goose Creek SC
|
Posted: Wed Sep 11, 2013 11:31 pm Post subject: |
|
|
backup from chroot if you can
backup from sysresccd/usb wtih gentoo partitions mounted and destination usb drive mounted _________________ Defund the FCC. |
|
Back to top |
|
|
TheCubeIsALie n00b
Joined: 11 Sep 2013 Posts: 19
|
Posted: Wed Sep 11, 2013 11:31 pm Post subject: |
|
|
auddoula wrote: | Jaglover wrote: | Personal files you cannot lose ... you will lose them in case of hard drive failure, so better back them up _now_.
|
right, I have an external USB drive. How can I back up when I cannot even see USB drive. On top of everything I do not have any write permission. |
Read DONAHUE's instructions. He provided some clear instructions on how to boot from a rescue cd to backup your data. |
|
Back to top |
|
|
auddoula Guru
Joined: 30 Apr 2008 Posts: 387
|
Posted: Wed Sep 11, 2013 11:47 pm Post subject: |
|
|
Thank you . I am burning a rescue CD. let's see how far I can go with detailed instructions from DONAHUE. |
|
Back to top |
|
|
auddoula Guru
Joined: 30 Apr 2008 Posts: 387
|
Posted: Thu Sep 12, 2013 12:14 am Post subject: |
|
|
DONAHUE wrote: |
fsck /dev/sda1
fsck /dev/sda3[/code] assuming that works; mount your gentoo partitions and enter the chroot: nominally: Code: | mount /dev/sda3 /mnt/gentoo
mount /dev/sda1 /mnt/gentoo/boot
mount -t proc none /mnt/gentoo/proc
mount --rbind /sys /mnt/gentoo/sys
mount --rbind /dev /mnt/gentoo/dev
chroot /mnt/gentoo /bin/bash
source /etc/profile
export PS1="(chroot) $PS1" | backup /root and /home to an external hard drive or flash dive or another internal hard drive.
post your status here, gentoo hopefully is running in the chroot in thr terminal
outside the terminal you can use the midori browser provided in the xfce GUI |
Both of devices sda1 and sda2 are clean. I was able to go through all the steps with no problem. I am attempting to backup my files but I have to figure out how to write to an external USB drive. I launched emelfm but I can't see the USB drive. I have a quite a lot of files to backup, it will take me a while. So, in the meantime if you want to tell me next steps, that would be great. Your instructions are very good, I thank you for that. |
|
Back to top |
|
|
Jaglover Watchman
Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
Posted: Thu Sep 12, 2013 12:30 am Post subject: |
|
|
While chroot is useful for system repair I fail to see why it is needed for backup.
BTW, it never crossed my mind we have to teach somebody who successfully installed Gentoo how to chroot or boot from USB/CD ... do we have a victim of Gentoo installer here? _________________ My Gentoo installation notes.
Please learn how to denote units correctly! |
|
Back to top |
|
|
auddoula Guru
Joined: 30 Apr 2008 Posts: 387
|
Posted: Thu Sep 12, 2013 12:35 am Post subject: |
|
|
Jaglover wrote: | While chroot is useful for system repair I fail to see why it is needed for backup.
BTW, it never crossed my mind we have to teach somebody who successfully installed Gentoo how to chroot or boot from USB/CD ... do we have a victim of Gentoo installer here? |
Good point. Once I install Gentoo, I forget the whole process. there are too many things to remember in life... I have a lot numeric data that need to be backed up, in case I lose my drive. It is just a precaution. |
|
Back to top |
|
|
Jaglover Watchman
Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
Posted: Thu Sep 12, 2013 12:36 am Post subject: |
|
|
While chroot is useful for system repair I fail to see why it is needed for backup.
BTW, it never crossed my mind we have to teach somebody who successfully installed Gentoo how to chroot or boot from USB/CD ... do we have a victim of Gentoo installer here? _________________ My Gentoo installation notes.
Please learn how to denote units correctly! |
|
Back to top |
|
|
DONAHUE Watchman
Joined: 09 Dec 2006 Posts: 7651 Location: Goose Creek SC
|
Posted: Thu Sep 12, 2013 1:46 am Post subject: |
|
|
For the backup: determine which listed drive and partition is the usb (nominally /dev/sdb1) and mount it, then:
either from chroot: Code: | mkdir /mnt/usb
mount /dev/sdb1 /mnt/usb
cp -af /home /mnt/usb/home
cp -af /root /mnt/usb/root |
or from the sysresccd/usb with gentoo partitions mounted but not in the chroot: : Code: | mkdir /mnt/gentoo/mnt/usb
mount /dev/sdb1 /mnt/gentoo/mnt/usb
cp -af /mnt/gentoo/home /mnt/gentoo/mnt/usb/home
cp -af /mnt/gentoo/root /mnt/gentoo/mnt/usb/root |
_________________ Defund the FCC. |
|
Back to top |
|
|
auddoula Guru
Joined: 30 Apr 2008 Posts: 387
|
Posted: Thu Sep 12, 2013 2:01 am Post subject: |
|
|
DONAHUE wrote: | For the backup: determine which listed drive and partition is the usb (nominally /dev/sdb1) and mount it, then:
either from chroot: Code: | mkdir /mnt/usb
mount /dev/sdb1 /mnt/usb
cp -af /home /mnt/usb/home
cp -af /root /mnt/usb/root |
|
Thank you, I managed to do that I believe, but I have about 1 TB to copy. SO, I let it copy overnight. But my main problem will start trying to restart the system. I left it without update for too long, and when I finally tried to do it, I made to many errors, especially with profile. So, I will bug you tomorrow since I am already back home. |
|
Back to top |
|
|
Jaglover Watchman
Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
Posted: Thu Sep 12, 2013 2:08 am Post subject: |
|
|
Based on limited information you provided in your initial post (you mentioned there was a power outage during upgrade) I recommended upgrading conf files first and see if the box will boot. Is there a reason you think this advice was useless? _________________ My Gentoo installation notes.
Please learn how to denote units correctly! |
|
Back to top |
|
|
auddoula Guru
Joined: 30 Apr 2008 Posts: 387
|
Posted: Thu Sep 12, 2013 2:21 am Post subject: |
|
|
Jaglover wrote: | Based on limited information you provided in your initial post (you mentioned there was a power outage during upgrade) I recommended upgrading conf files first and see if the box will boot. Is there a reason you think this advice was useless? |
Not at all. I shall try that tomorrow when I am back to work. i will let you know how that goes. Thank you for your suggestion. |
|
Back to top |
|
|
DONAHUE Watchman
Joined: 09 Dec 2006 Posts: 7651 Location: Goose Creek SC
|
Posted: Thu Sep 12, 2013 3:33 am Post subject: |
|
|
Did you choose mdev over udev? _________________ Defund the FCC. |
|
Back to top |
|
|
auddoula Guru
Joined: 30 Apr 2008 Posts: 387
|
Posted: Thu Sep 12, 2013 11:26 am Post subject: |
|
|
DONAHUE wrote: | Did you choose mdev over udev? |
I believe I chose mdev mostly because I did not know the differences between them well enough. |
|
Back to top |
|
|
auddoula Guru
Joined: 30 Apr 2008 Posts: 387
|
Posted: Thu Sep 12, 2013 12:29 pm Post subject: |
|
|
Jaglover wrote: | Personal files you cannot lose ... you will lose them in case of hard drive failure, so better back them up _now_.
Then run dispatch-conf (or etc-update) to make sure your conf is consistent with the state of your system. If you still have problems logging in post back. |
I have updated etc-update. rebooted, but I still have exactly the same problem as initially. No apparent change whatsoever, i.e. I get the same black screen with (none).unknown_domain screen. |
|
Back to top |
|
|
auddoula Guru
Joined: 30 Apr 2008 Posts: 387
|
Posted: Fri Sep 13, 2013 2:54 am Post subject: |
|
|
auddoula wrote: |
I have updated etc-update. rebooted, but I still have exactly the same problem as initially. No apparent change whatsoever, i.e. I get the same black screen with (none).unknown_domain screen. |
Hello everyone, any other suggestions as to how to get the system back up? |
|
Back to top |
|
|
DONAHUE Watchman
Joined: 09 Dec 2006 Posts: 7651 Location: Goose Creek SC
|
Posted: Fri Sep 13, 2013 4:07 am Post subject: |
|
|
You can elect to repair which will be more fun or you can elect to replace/reinstall.
Boot and see if Code: | mount -o remount,rw / | will give read write access. If that works start services manually if you can.
If repair is your choice, from boot and remount rw or from the chroot find out if wgetpaste is installed; if not find out if will work. post your decision and result for wgetpaste. _________________ Defund the FCC. |
|
Back to top |
|
|
auddoula Guru
Joined: 30 Apr 2008 Posts: 387
|
Posted: Fri Sep 13, 2013 10:55 am Post subject: |
|
|
DONAHUE wrote: | You can elect to repair which will be more fun or you can elect to replace/reinstall.
Boot and see if Code: | mount -o remount,rw / | will give read write access. If that works start services manually if you can.
If repair is your choice, from boot and remount rw or from the chroot find out if wgetpaste is installed; if not find out if will work. post your decision and result for wgetpaste. |
OK, thank you. I will try that as soon as I get to work later this morning. The only immediate problem I see is that I cannot login as a root, so will I be able to mount? But I will give it a shot, I definitely prefer to repair it, if possible. |
|
Back to top |
|
|
auddoula Guru
Joined: 30 Apr 2008 Posts: 387
|
Posted: Fri Sep 13, 2013 1:57 pm Post subject: |
|
|
DONAHUE wrote: |
If repair is your choice, from boot and remount rw or from the chroot find out if wgetpaste is installed; if not find out if will work. post your decision and result for wgetpaste. | I decided to repair, but could not remount. However, from chroot I can do wgetpaste. |
|
Back to top |
|
|
auddoula Guru
Joined: 30 Apr 2008 Posts: 387
|
Posted: Fri Sep 13, 2013 3:28 pm Post subject: |
|
|
Just as an update, I added root password in chroot, rebooted, but nothing changed. I was not able to login as a root, only as a user with read-only permission. Essentially there is no 'effective root'. I don't have the network either (However, I can do so from rescue CD). |
|
Back to top |
|
|
DONAHUE Watchman
Joined: 09 Dec 2006 Posts: 7651 Location: Goose Creek SC
|
Posted: Fri Sep 13, 2013 4:09 pm Post subject: |
|
|
Code: | emerge --info | wgetpaste
ls /etc/init.d | wgetpaste
rc-update show | wgetpaste
wgetpaste /etc/portage/make.conf
emerge -pvuND world | wgetpaste
eselect profile list | wgetpaste | and post the url's returned
edit to add profile to list _________________ Defund the FCC. |
|
Back to top |
|
|
auddoula Guru
Joined: 30 Apr 2008 Posts: 387
|
Posted: Fri Sep 13, 2013 4:55 pm Post subject: |
|
|
[profile=][/profile] DONAHUE wrote: | Code: | emerge --info | wgetpaste
ls /etc/init.d | wgetpaste
rc-update show | wgetpaste
wgetpaste /etc/portage/make.conf
emerge -pvuND world | wgetpaste
eselect profile list | wgetpaste | and post the url's returned
edit to add profile to list |
here it is:
emerge --info | wgetpaste
http://bpaste.net/show/132145/
ls /etc/init.d | wgetpaste
http://bpaste.net/show/132147/
rc-update show | wgetpaste
bash: rc-update: command not found
No input read. Nothing to paste. Aborting.
wgetpaste /etc/portage/make.conf
/usr/bin/wgetpaste: /etc/portage/make.conf No such file found
however I have this one: wgetpaste /etc/make.conf
http://bpaste.net/show/132177/
eselect profile list | wgetpaste
http://bpaste.net/show/132148/
emerge -pvuND world | wgetpaste
* Last emerge --sync was 1y 41d 11h 24m 54s ago.
http://bpaste.net/show/132149/
I am not sure how it is possible for make.conf to disappear.
Last edited by auddoula on Fri Sep 13, 2013 6:20 pm; edited 3 times in total |
|
Back to top |
|
|
|