Thanks Alan,

Whew!  You gave me a lot to respond to and it will take a bit of time
since I have to run between two computer.

Alan McKinnon wrote:
> On Sunday 09 September 2007, Colleen Beamer wrote:

> 
> I'll give you a verbose reply in the hopes that we can get to the root 
> of the problem right away
> 
>> This morning as I was getting my son off to work, he got me upset
>> about something and I walked over to my laptop and instead of hitting
>> the 'On' button, I accidentally hit the 'Media Direct' button.  (I'm
>> explaining the why so you won't thing that I'm a total airhead!). 
>> The laptop is a Dell XPS M1710.  The Dell Media Direct Splash screen
>> display, but of course, did nothing else 'cause there is only Linux
>> on the laptop.
> 
> I'm not familiar with that 'Media Direct' thing, no Dell I've ever 
> worked on has such a thing. Can you fill me in on what it does, so we 
> can try figure out what dastardly thing it did to your system?

Truthfully, I'm not sure what it does.  I have never had a computer with
that button either and I don't have Windows on the laptop - I installed
Gentoo right away.  All I know is that when I hit that button thinking
that I had hit the power button and walked away, the splash screen with
"Dell Media Direct" was displayed.
> 
> 
>> Anyway, this corrupted my boot partition, but I was able to fix that.
>>  I just deleted the partition that hitting the 'Media Direct' button
>> made. It put this at the end of the hard drive, but it was made the
>> bootable partition and had a DOS/Windows partition type.
> 
> bootable partition markers are ignored under Linux, they make no real 
> sense with a real boot loader like grub.
> 
> The Media Direct making a partition and you deleting it should not 
> affect anything. It's a lot like creating a file - it doesn;t affect 
> the existing files. Unless of course the Media Direct trashed an 
> existing partition, which no sane software should ever do.

Well, I don't know about this either.  All I know is that the partition
that was created by Media Direct was tacked on at the end of the drive
as indicated by the start and end sectors.  However, when I did ran
fdisk to print the partition scheme to the screen, the Media Direct
partition showed as sda1 (which *was* my boot partition) and it showed
as bootable, so I thought it had overwritten the boot partition.  It did
corrupt the mbr because the computer wouldn't boot.
> 
>> I deleted the partition that hitting the 'Media Direct' button had
>> made, then recreated a new Linux partition with an ext2 file system
>> and made this bootable where the original boot partition had been.
> 
> OK. That's the long way round but it seems like you got it fixed anyway. 
> I find it to be a good idea to keep a spare copy of the files in /boot 
> for cases like this - saves having to recompile the kernel

After following what I thought were all the relevant steps in the Gentoo
Handbook, the first time I tried to boot from the hard drive, I got a
message that the file couldn't be found - it focused on the line in
grub.conf that starts with 'kernel /kernel ...' so I figured that it was
because I hadn't compiled the kernel, so I compiled it.  When I did this
in my chroot'd environment, it picked up the settings from my last
kernel compilation before this situation occurred.  To explain, I use
genkernel and deselected anything related to AMD because my system is
Intel based.  When I ran 'genkernel -- menuconfig all' anything related
to AMD was still deselected.
> 
>> Then, I followed the Gentoo Handbook, doing all the relevant steps
>> except for downloading software that was already there.  I chroot'd
>> into my environment to install grub - I did all the relevant steps
>> including chrooting into my own environment.  In my chroot'd
>> environment, I can do an 'ls' and it reads the drives.  I can also
>> edit files like grub.conf and fstab, so there isn't a problem with my
>> remaining partitions after reconfiguring the boot partition.
>>
>> I reinstalled grub, created grub.conf and ran grub-install and that
>> was successful.
>>
>> However, when I reboot, I get a garbled screen, but I *can* make out
>> the text, although barely.
> 
> Thats tells me the grub install did not in fact go right. But no matter, 
> it seems to work so once we get the OS running, we can fix the grub 
> later. Meanwhile just remember that you have to navigate grub blind 
> when booting

When I ran grub-install /dev/sda (my hard drive is a SATA), it returned
the expected lines.
> 
>> It goes through the boot process and gets to the point where
>> 'Activating mdev' is displayed
>>
>> Then, the following is displayed:
>> Determining root device
>> Block dev sda3 is not a valid root device
>> The root block device is unspecified or not detected.
> 
> That is the root of your problem and is one of two things:
> 
> /dev/sda3 is corrupt, or
> /dev/sda3 is nto the partition you boot from and grub.conf is corrupt

I can't categorically say that /dev/sda is not corrupt.  However, like I
said, I can edit fstab in the chroot'd environment and if I do ls it
returns the list of files and directories.

The same happens when I do 'ls home' which is /dev/sda4.

My boot partition is /dev/sda1.  I had to reemerge grub and it installed
in the correct place.
> 
>> Of note and I'm not sure if this is where the problem is, is that
>> when I was mounting my partitions prior to chroot'ing into my own
>> environment, I got a message about maximal mount count and it told me
>> I should run e2fsck.  I tried this and got an error message. 
>> However, my hard drive is not ext2, it is ext3.
> 
> That's normal. ext2 does a file system check every 20 or so mounts as a 
> safety feature, and this time just happened to be your turn. e2fsck 
> willnormally do it's thing as exit without having to do anything. This 
> is good, as you don't expect the filesystem to be damaged normally, and 
> it's good to see that they are in fact intact.
> 
> That you use ext3 is also not relevant - ext3 is a new! improved! ext2 
> with one awesomely useful extra feature. Any tool necessary on ext2 
> still works on ext3.
> 
>> I apologize for the length of this, but I wanted to try to explain
>> everything.  I'm having fits here - I'm writing from my old 686
>> computer which did have all my files on it.  However, I ftp'd them to
>> my webspace and then back down to the laptop.  When I did that, I
>> deleted most of them off the 686 and as luck would have it I didn't
>> do a recent backup from the laptop.  I do have an older backup, but
>> would lose some recent files if I can't get my laptop up and running
>> without a reinstall.
> 
> I'd need some info at this point to help you further. You will likely 
> need to boot off a LiveCD or rescue disk to get to this, then mount the 
> root partition and chroot into it. Do you know the procedure for that?

Yes.  I'll tell you exactly what I did after recreating the boot
partition, then perhaps you can figure out if and where I went wrong.

First, I booted to the Gentoo install CD.  I'm still using the 2006.1,
but I don't figure that makes a difference 'cause all the files get
updated anyway and I do a network install the get the snapshots, etc.

2)  For some reason my network device is never automatically detected
when the install CD boots, so I have to run 'net-setup eth0' and then
I'm fine.  I checked network connectivity.

3)  I mounted the following:
mount /dev/sda3 /mnt/gentoo
mount /dev/sda1 /mnt/gentoo boot
This was after I had recreated the boot partition and created the file
system on it.

4)  I skipped ahead 'cause I didn't need to install the base system or
portage - the files are all there when I do 'ls /mnt/gentoo/'

Then, I did:

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

chroot /mnt/gentoo /bin/bash
env-update
source /etc/profile

At this point, you would normally do an 'emerge --sync', but I didn't

I *did* do 'ls -FGg /etc/make.profile and it returned the expected

5)  I did the step:

zcat /proc/config.gz > /usr/share/genkernel/x86/kernel-conf-2.6

The ran 'genkernel --menuconfig all'

6)  Then I did the grub stuff

emerge grub
created grub.conf

'grep -v rootfs /proc/mounts > /etc/mtab

grub-install /dev/sda

As previously stated, grub installed in the correct place (sda1)

7)  The I exited and unmounted the mounted partitions and rebooted.

> 
> What was your partition layout before this mistake happened? If you can 
> remember how many partitions you had, their size, the order they were 
> in and where they were mounted, that info would be useful.

This is/was my partition scheme and the output of fdisk -l.  The only
one I messed with today was the first one:

Disk: /dev/sda
100.0 GB 100030242816 bytes
255 heads 63 sectors/track
12161 cylinders
Units=cylinders of 16065*512=8225280 bytes


Device      Boot  Start  End    Blocks    ID    System

/dev/sda1    *    1      17     136552    83    Linux
/dev/sda2         18     516    4008217+  82    Linux swap / Solaris
/dev/sda3         517    5380   3900080   83    Linux
/dev/sda4         5381   121161 54468382+ 83    Linux


> 
> The contents of your /etc/fstab and /boot/grub/grub.conf

Will send this later if you still think you need it after reading this
> 
> The output of 'fdisk -l /dev/sda'

See above
> 
> The output of e2fsck, run on each of your filesystems
> 
e2fsck for both sda1 (boot) and sda4 (home) come back clean

Output from e2fsck for /dev/sda3 is:

Pass
1       Checking inodes, blocks and sizes
2       Checking Directory Structure
3       Checking Directory connectivity
4       Checking Reference counts
5       Checking Summary information

/dev/dsa3: 437650/4889248 files (4.3% non-contiguous) 2203865/9767520 blocks

I supposed if worse comes to worse, I can resintall /dev/sda3 - my home
partition would remain intact on /dev/sda4

Anyway, let me know what else you need (besides maybe contents of fstab
and grub.conf

Although the fstab and grub.conf are exactly what they were before
hitting that damned "Media Direct" button.

Regards,

Colleen


-- 

Registered Linux User #411143 with the Linux Counter, http://counter.li.org
-- 
[EMAIL PROTECTED] mailing list

Reply via email to