Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Can't boot, /dev/ mostly empty, and no sys-fs/udev
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
jasonstjohn
n00b
n00b


Joined: 20 Aug 2009
Posts: 6

PostPosted: Thu Aug 20, 2009 9:41 pm    Post subject: Can't boot, /dev/ mostly empty, and no sys-fs/udev Reply with quote

Hello, List.

I am looking at one very sad hp Compaq nc6400, which only this morning was home to a system built up from LiveCD 2008.0-r1 i686. Yesterday I tooled around trying to address some blocked packages, and unmerged more than I should have. Clearly I was wrong to think that I can put it all back the way it was, because rebooting is now a tedious process with a repeated, failing attempt to do... somthing:

Quote:
ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen
ata1.00: cmd a0/00:00:00:24:00/00:00:00:00:00:00/a0 tag 0 pio 36 frozen
cdb 12 00 00 00 24 00 00 00 00 00 00 00 00 00 00 00 00
res 40/00:00:00:00:00/00:00:00:00:00:00/00 Emask 0x4 (timeout)
ata1.00: status: { DRDY }
ata1: soft resetting link
ata1.00: confirgured for PIO3
ata1: EH complete
ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen
///....etc

....which repeats again with PIO0 after the message "limiting speed to PIO0" and eventually
Quote:
ata1: WARNING: synchronous SCSI scan failed without making any progress, switching to async

... and then we begin to make some headway, load some modules, activate mdev, mount root, and begin booting (intramfs)
Quote:
INIT: version 2.86 booting

which looks very normal to me, but only gets off these two successful mounts:
Quote:
proc at /proc
sysfs at /sys

and then
Quote:
* The Gentoo Linux system initialization scripts have detected that
* your sytem does not support UDEV. Since Gentoo Linux has been
* designed with dynamic /dev in mind, it is highly suggested that you
* emerge sys-fs/udev and configure your system to use it.

Then we wrap up bymounting devpts at /dev, and fail when checking the filesystem:
Quote:
fsck.ext3 No such file or directory while trying to open/dev/sda3

Quote:
(none) ~ # cat /etc/fstab
/dev/sda1 /boot ext2 defaults 12
/dev/sda2 none swap sw 00
/dev/sda3 / ext3 noatime 01
none /proc proc defaults 00
none /dev/shm tmpfs defaults 00

I'm able to log in as root, then, and sure enough, /dev is nearly empty: console, null, pts, shm, and tty1 are the only things there. The entire filesystem seems to be read only, so I cannot emerge anything, and cannot ssh from the machine.

I have never worked at this level in my system before. I think I would desperately try just about any suggestion which seems even halfway promising!

Cheers,
_jmsj
Back to top
View user's profile Send private message
cach0rr0
Bodhisattva
Bodhisattva


Joined: 13 Nov 2008
Posts: 4123
Location: Houston, Republic of Texas

PostPosted: Thu Aug 20, 2009 9:55 pm    Post subject: Reply with quote

ouch

You might snag the udev binaries from here (for amd64) http://tinderbox.dev.gentoo.org/default-linux/amd64/sys-fs/

or here for x86 http://tinderbox.dev.gentoo.org/default-linux/x86/sys-fs/

If that's all it is, that might patch you back together.

I'm betting you unmerged e2fsprogs as well - might snag those binaries too

Now this is all for naught if you don't have physical access - do you have physical access? If so, boot from a CD or thumb drive (and do NOT use the 2008-r1 .iso, as it's both deprecated and garbage), mount per the handbook, and chroot. You may be able to re-emerge the stuff that's gone, depending upon how much stuff you lost.

...of course if you only installed this yesterday, haven't done heaps of customization, and don't have any data on there you care about recovering, let's just rebuild the sucker. In fact you can boot from rescuecd, mount, and copy the stuff off to a backup drive

One way or another though, youll want to boot from a CD or thumb drive, nothing you can do from the console itself when booted from that mangled an install (well, not without more pain than itd be to install in the first place)


ALSO: if youre worried about having to recompile packages, you can use quickpkg to bundle the things up and move em off to a safe spot
_________________
Lost configuring your system?
dump lspci -n here | see Pappy's guide | Link Stash
Back to top
View user's profile Send private message
jasonstjohn
n00b
n00b


Joined: 20 Aug 2009
Posts: 6

PostPosted: Sat Aug 22, 2009 5:18 pm    Post subject: Reply with quote

Thanks, cach0rr0. This install's about half a year old; I'll try to patch it back together before
I fall back on the backup records and a fresh install.

Booting with a handy LiveCD, I can
Quote:
gentoo@livecd ~ $ sudo mount --verbose -t ext3 /dev/sda3 /mount
/dev/sda3 on /mount type ext3 (rw)

so that at least I'm able to write to the old filesystem again. But what I don't know is how to have emerge pretend this is the / directory. (I think if I knew how, I would unpack and install it myself.)

I checked what is there already:
Quote:
gentoo@livecd ~ $ ls -l /mount/usr/portage/sys-fs/udev
total 248
-rw-r--r-- 1 root root 98780 Aug 15 22:37 ChangeLog
-rw-r--r-- 1 root root 11621 Aug 15 22:37 Manifest
drwxr-xr-x 3 root root 4096 Aug 10 13:07 files
-rw-r--r-- 1 root root 402 Jun 18 09:36 metadata.xml
-rw-r--r-- 1 root root 9053 May 7 00:15 udev-114.ebuild
-rw-r--r-- 1 root root 10130 May 7 00:15 udev-115-r1.ebuild
-rw-r--r-- 1 root root 10169 May 7 00:15 udev-119.ebuild
-rw-r--r-- 1 root root 10678 Jul 16 09:07 udev-124-r1.ebuild
-rw-r--r-- 1 root root 11035 Jul 16 09:07 udev-124-r2.ebuild
-rw-r--r-- 1 root root 13023 Jun 17 13:36 udev-141-r1.ebuild
-rw-r--r-- 1 root root 12473 Aug 9 11:36 udev-141.ebuild
-rw-r--r-- 1 root root 13606 Aug 15 22:37 udev-145.ebuild
-rw-r--r-- 1 root root 13330 Jul 16 08:10 udev-9999.ebuild

and, while I don't know much about what should be where upon completing a package installation correctly, it's clear that udev isn't available to run, nevertheless:
Quote:
gentoo@livecd ~ $ ls /mount/usr/bin/ | grep dev
devdump
devnag
hal-device
xfmountdev4


So for the moment, I'm thinking about how to get around this:
Quote:
gentoo@livecd ~ $ sudo emerge --verbose /mount/usr/portage/sys-fs/udev/udev-141-r1.ebuild

*** emerging by path is broken and may not always work!!!


These are the packages that would be merged, in order:

Calculating dependencies \
!!! /mount/usr/portage/sys-fs/udev/udev-141-r1.ebuild is not in a valid portage tree hierarchy or does not exist


Ideas?

Cheers,
_jmsj
Back to top
View user's profile Send private message
Simba7
l33t
l33t


Joined: 22 Jan 2007
Posts: 708
Location: Billings, MT, USA

PostPosted: Sat Aug 22, 2009 5:43 pm    Post subject: Reply with quote

jasonstjohn wrote:
Quote:
gentoo@livecd ~ $ sudo emerge --verbose /mount/usr/portage/sys-fs/udev/udev-141-r1.ebuild

*** emerging by path is broken and may not always work!!!


These are the packages that would be merged, in order:

Calculating dependencies \
!!! /mount/usr/portage/sys-fs/udev/udev-141-r1.ebuild is not in a valid portage tree hierarchy or does not exist


Ideas?

Cheers,
_jmsj

You definitely are a noob.. :D

Enter this:
sudo emerge =sys-fs/udev-141-r1

I would suggest going in as root, though. If you do, get rid of sudo.
Back to top
View user's profile Send private message
jasonstjohn
n00b
n00b


Joined: 20 Aug 2009
Posts: 6

PostPosted: Sat Aug 22, 2009 7:44 pm    Post subject: Reply with quote

:) In some way, isn't each of us a noob?

Booting from the LiveCD, I get to be the user gentoo, but cannot become root:
Quote:
gentoo@livecd ~ $ su -
Password:
su: Authentication failure
Sorry.

Booting from the harddrive with the sick installation, I get to be root, but emerge can't do its business so long as /dev/sda3 is mounted read-only.

So, I can work at a lower level, I can try with ebuild:
Quote:

gentoo@livecd ~ $ sudo ebuild /mount/usr/portage/sys-fs/udev/udev-141-r1.ebuild setup
Appending /mount/usr/portage to PORTDIR_OVERLAY...
gentoo@livecd ~ $ sudo ebuild /mount/usr/portage/sys-fs/udev/udev-141-r1.ebuild fetch
Appending /mount/usr/portage to PORTDIR_OVERLAY...
Adjusting permissions recursively: '/mnt/livecd/usr/portage/distfiles/'
Adjusting permissions recursively: '/mnt/livecd/usr/portage/distfiles/.locks'
>>> Downloading 'http://distfiles.gentoo.org/distfiles/udev-141.tar.bz2'
--23:22:23-- http://distfiles.gentoo.org/distfiles/udev-141.tar.bz2
=> `/mnt/livecd/usr/portage/distfiles/udev-141.tar.bz2'
Resolving distfiles.gentoo.org... 204.152.191.39, 156.56.247.195, 149.20.20.135, ...
Connecting to distfiles.gentoo.org|204.152.191.39|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://mirrors.kernel.org/gentoo/distfiles/udev-141.tar.bz2 [following]
--23:22:24-- http://mirrors.kernel.org/gentoo/distfiles/udev-141.tar.bz2
=> `/mnt/livecd/usr/portage/distfiles/udev-141.tar.bz2'
Resolving mirrors.kernel.org... 149.20.20.135, 204.152.191.39
Reusing existing connection to distfiles.gentoo.org:80.
HTTP request sent, awaiting response... 200 OK
Length: 448,373 (438K) [application/x-bzip2]

100%[======================================================================>] 448,373 215.95K/s

23:22:26 (215.43 KB/s) - `/mnt/livecd/usr/portage/distfiles/udev-141.tar.bz2' saved [448373/448373]

* checking ebuild checksums ;-) ... [ ok ]
* checking auxfile checksums ;-) ... [ ok ]
* checking miscfile checksums ;-) ... [ ok ]
* checking udev-141.tar.bz2 ;-) ... [ ok ]
gentoo@livecd ~ $ sudo ebuild /mount/usr/portage/sys-fs/udev/udev-141-r1.ebuild compile
Appending /mount/usr/portage to PORTDIR_OVERLAY...
>>> Existing ${T}/environment for 'udev-141-r1' will be sourced. Run
>>> 'clean' to start with a fresh environment.
* udev-141.tar.bz2 RMD160 SHA1 SHA256 size ;-) ... [ ok ]
* checking ebuild checksums ;-) ... [ ok ]
* checking auxfile checksums ;-) ... [ ok ]
* checking miscfile checksums ;-) ... [ ok ]
* checking udev-141.tar.bz2 ;-) ... [ ok ]
>>> Unpacking source...
>>> Unpacking udev-141.tar.bz2 to /var/tmp/portage/sys-fs/udev-141-r1/work
>>> Source unpacked.
>>> Compiling source in /var/tmp/portage/sys-fs/udev-141-r1/work/udev-141 ...

...and I'll stop right there because, although 'compile' and 'install' can complete without strong complaints,
they only seem to address /var/tmp, whereas for me, with everything important starting at /mount rather than the / directory, this is not going to last through a boot, I don't think. I'll unmount my /mount and try a reboot... Back in a sec.
Back to top
View user's profile Send private message
jasonstjohn
n00b
n00b


Joined: 20 Aug 2009
Posts: 6

PostPosted: Sat Aug 22, 2009 8:37 pm    Post subject: Reply with quote

Just before rebooting, since I'd noticed that ebuild compiles to /var/tmp/portage/sys-fs/udev, I mv'd everything there to the corresponding location on the harddrive....

...and in fact, I booted off the harddrive, was chastened for not having udev installed, fell back being root but unable to see /dev/sda3 (the same old rigamarole), and out of curiosity checked what I could see in the harddrive at /var/tmp/portage/sys-fs/udev/. It's all there, just where I would want it to be, if I were a system running udev.

What in the world else needs to be done for udev to run on this drive? The ebuild man pages make me think it's qmerging I've omitted. Sure enough, here's where it becomes a problem that the drive I want to install onto is mounted at /mount, whereas I can't (yet) persuade ebuild that it should start all paths there:
Quote:

gentoo@livecd ~ $ sudo ebuild /mount/usr/portage/sys-fs/udev/udev-141-r1.ebuild qmerge
Appending /mount/usr/portage to PORTDIR_OVERLAY...
* udev-141.tar.bz2 RMD160 SHA1 SHA256 size ;-) ... [ ok ]
* checking ebuild checksums ;-) ... [ ok ]
* checking auxfile checksums ;-) ... [ ok ]
* checking miscfile checksums ;-) ... [ ok ]
* checking udev-141.tar.bz2 ;-) ... [ ok ]
Traceback (most recent call last):
File "/usr/bin/ebuild", line 183, in ?
debug=debug, tree=mytree)
File "/usr/lib/portage/pym/portage.py", line 4803, in doebuild
mydbapi=mydbapi, vartree=vartree, prev_mtimes=prev_mtimes)
File "/usr/lib/portage/pym/portage.py", line 5013, in merge
mydbapi=mydbapi, prev_mtimes=prev_mtimes)
File "/usr/lib/portage/pym/portage.py", line 9486, in merge
mydbapi=mydbapi, prev_mtimes=prev_mtimes)
File "/usr/lib/portage/pym/portage.py", line 9491, in _merge
self.lockdb()
File "/usr/lib/portage/pym/portage.py", line 8041, in lockdb
self._lock_vdb = portage_locks.lockdir(self.dbroot)
File "/usr/lib/portage/pym/portage_locks.py", line 20, in lockdir
return lockfile(mydir,wantnewlockfile=1)
File "/usr/lib/portage/pym/portage_locks.py", line 54, in lockfile
myfd = os.open(lockfilename, os.O_CREAT|os.O_RDWR,0660)
OSError: [Errno 30] Read-only file system: '/var/db/.pkg.portage_lockfile'

Perhaps I could build a prison at /mount, and run it in there....
Back to top
View user's profile Send private message
cach0rr0
Bodhisattva
Bodhisattva


Joined: 13 Nov 2008
Posts: 4123
Location: Houston, Republic of Texas

PostPosted: Sat Aug 22, 2009 9:06 pm    Post subject: Reply with quote

the root pass on the livecd is autoscrambled IIRC

instead do

Code:
sudo su -


What you need to do is

-boor from the livecd
-do all of the mount steps it mentions

Code:

mount /dev/sda3 /mnt/gentoo
mount -t proc none /mnt/gentoo/proc
mount -o bind /dev /mnt/gentoo/dev
chroot /mnt/gentoo /bin/bash
env-update
source /etc/profile


You should then have function /dev, as prepped by the livecd. This should allow you to emerge what you need to get things back to operational.

You're basically mounting the livecd's /dev on /mnt/gentoo/dev
which when you chroot simply becomes /dev relative to the chroot

anyway, try that
_________________
Lost configuring your system?
dump lspci -n here | see Pappy's guide | Link Stash
Back to top
View user's profile Send private message
jasonstjohn
n00b
n00b


Joined: 20 Aug 2009
Posts: 6

PostPosted: Wed Sep 02, 2009 11:40 am    Post subject: problem solved Reply with quote

Sorry it took me so long to post back here.
The fix is in, udev is once again emerged, and this system is back to its old self.
<: Thank you very, very much!

Cheers,
_jmsj
Back to top
View user's profile Send private message
cach0rr0
Bodhisattva
Bodhisattva


Joined: 13 Nov 2008
Posts: 4123
Location: Houston, Republic of Texas

PostPosted: Wed Sep 02, 2009 2:24 pm    Post subject: Reply with quote

glad to hear it. Please mark this one as [SOLVED] when you have a chance
_________________
Lost configuring your system?
dump lspci -n here | see Pappy's guide | Link Stash
Back to top
View user's profile Send private message
jasonstjohn
n00b
n00b


Joined: 20 Aug 2009
Posts: 6

PostPosted: Wed Sep 02, 2009 5:02 pm    Post subject: Can't boot, /dev/ mostly empty, and no sys-fs/udev [SOLVED] Reply with quote

Sure, happy to... but what do I do to mark it [SOLVED]? This is some interface, I tell ya....
_jmsj
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum