Gentoo Archives: gentoo-user

From: Colleen Beamer <colleen.beamer@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Boot situation
Date: Sun, 09 Sep 2007 19:46:39
Message-Id: 46E44A91.4090608@gmail.com
In Reply to: Re: [gentoo-user] Boot situation by Alan McKinnon
1 Thanks Alan,
2
3 Whew! You gave me a lot to respond to and it will take a bit of time
4 since I have to run between two computer.
5
6 Alan McKinnon wrote:
7 > On Sunday 09 September 2007, Colleen Beamer wrote:
8
9 >
10 > I'll give you a verbose reply in the hopes that we can get to the root
11 > of the problem right away
12 >
13 >> This morning as I was getting my son off to work, he got me upset
14 >> about something and I walked over to my laptop and instead of hitting
15 >> the 'On' button, I accidentally hit the 'Media Direct' button. (I'm
16 >> explaining the why so you won't thing that I'm a total airhead!).
17 >> The laptop is a Dell XPS M1710. The Dell Media Direct Splash screen
18 >> display, but of course, did nothing else 'cause there is only Linux
19 >> on the laptop.
20 >
21 > I'm not familiar with that 'Media Direct' thing, no Dell I've ever
22 > worked on has such a thing. Can you fill me in on what it does, so we
23 > can try figure out what dastardly thing it did to your system?
24
25 Truthfully, I'm not sure what it does. I have never had a computer with
26 that button either and I don't have Windows on the laptop - I installed
27 Gentoo right away. All I know is that when I hit that button thinking
28 that I had hit the power button and walked away, the splash screen with
29 "Dell Media Direct" was displayed.
30 >
31 >
32 >> Anyway, this corrupted my boot partition, but I was able to fix that.
33 >> I just deleted the partition that hitting the 'Media Direct' button
34 >> made. It put this at the end of the hard drive, but it was made the
35 >> bootable partition and had a DOS/Windows partition type.
36 >
37 > bootable partition markers are ignored under Linux, they make no real
38 > sense with a real boot loader like grub.
39 >
40 > The Media Direct making a partition and you deleting it should not
41 > affect anything. It's a lot like creating a file - it doesn;t affect
42 > the existing files. Unless of course the Media Direct trashed an
43 > existing partition, which no sane software should ever do.
44
45 Well, I don't know about this either. All I know is that the partition
46 that was created by Media Direct was tacked on at the end of the drive
47 as indicated by the start and end sectors. However, when I did ran
48 fdisk to print the partition scheme to the screen, the Media Direct
49 partition showed as sda1 (which *was* my boot partition) and it showed
50 as bootable, so I thought it had overwritten the boot partition. It did
51 corrupt the mbr because the computer wouldn't boot.
52 >
53 >> I deleted the partition that hitting the 'Media Direct' button had
54 >> made, then recreated a new Linux partition with an ext2 file system
55 >> and made this bootable where the original boot partition had been.
56 >
57 > OK. That's the long way round but it seems like you got it fixed anyway.
58 > I find it to be a good idea to keep a spare copy of the files in /boot
59 > for cases like this - saves having to recompile the kernel
60
61 After following what I thought were all the relevant steps in the Gentoo
62 Handbook, the first time I tried to boot from the hard drive, I got a
63 message that the file couldn't be found - it focused on the line in
64 grub.conf that starts with 'kernel /kernel ...' so I figured that it was
65 because I hadn't compiled the kernel, so I compiled it. When I did this
66 in my chroot'd environment, it picked up the settings from my last
67 kernel compilation before this situation occurred. To explain, I use
68 genkernel and deselected anything related to AMD because my system is
69 Intel based. When I ran 'genkernel -- menuconfig all' anything related
70 to AMD was still deselected.
71 >
72 >> Then, I followed the Gentoo Handbook, doing all the relevant steps
73 >> except for downloading software that was already there. I chroot'd
74 >> into my environment to install grub - I did all the relevant steps
75 >> including chrooting into my own environment. In my chroot'd
76 >> environment, I can do an 'ls' and it reads the drives. I can also
77 >> edit files like grub.conf and fstab, so there isn't a problem with my
78 >> remaining partitions after reconfiguring the boot partition.
79 >>
80 >> I reinstalled grub, created grub.conf and ran grub-install and that
81 >> was successful.
82 >>
83 >> However, when I reboot, I get a garbled screen, but I *can* make out
84 >> the text, although barely.
85 >
86 > Thats tells me the grub install did not in fact go right. But no matter,
87 > it seems to work so once we get the OS running, we can fix the grub
88 > later. Meanwhile just remember that you have to navigate grub blind
89 > when booting
90
91 When I ran grub-install /dev/sda (my hard drive is a SATA), it returned
92 the expected lines.
93 >
94 >> It goes through the boot process and gets to the point where
95 >> 'Activating mdev' is displayed
96 >>
97 >> Then, the following is displayed:
98 >> Determining root device
99 >> Block dev sda3 is not a valid root device
100 >> The root block device is unspecified or not detected.
101 >
102 > That is the root of your problem and is one of two things:
103 >
104 > /dev/sda3 is corrupt, or
105 > /dev/sda3 is nto the partition you boot from and grub.conf is corrupt
106
107 I can't categorically say that /dev/sda is not corrupt. However, like I
108 said, I can edit fstab in the chroot'd environment and if I do ls it
109 returns the list of files and directories.
110
111 The same happens when I do 'ls home' which is /dev/sda4.
112
113 My boot partition is /dev/sda1. I had to reemerge grub and it installed
114 in the correct place.
115 >
116 >> Of note and I'm not sure if this is where the problem is, is that
117 >> when I was mounting my partitions prior to chroot'ing into my own
118 >> environment, I got a message about maximal mount count and it told me
119 >> I should run e2fsck. I tried this and got an error message.
120 >> However, my hard drive is not ext2, it is ext3.
121 >
122 > That's normal. ext2 does a file system check every 20 or so mounts as a
123 > safety feature, and this time just happened to be your turn. e2fsck
124 > willnormally do it's thing as exit without having to do anything. This
125 > is good, as you don't expect the filesystem to be damaged normally, and
126 > it's good to see that they are in fact intact.
127 >
128 > That you use ext3 is also not relevant - ext3 is a new! improved! ext2
129 > with one awesomely useful extra feature. Any tool necessary on ext2
130 > still works on ext3.
131 >
132 >> I apologize for the length of this, but I wanted to try to explain
133 >> everything. I'm having fits here - I'm writing from my old 686
134 >> computer which did have all my files on it. However, I ftp'd them to
135 >> my webspace and then back down to the laptop. When I did that, I
136 >> deleted most of them off the 686 and as luck would have it I didn't
137 >> do a recent backup from the laptop. I do have an older backup, but
138 >> would lose some recent files if I can't get my laptop up and running
139 >> without a reinstall.
140 >
141 > I'd need some info at this point to help you further. You will likely
142 > need to boot off a LiveCD or rescue disk to get to this, then mount the
143 > root partition and chroot into it. Do you know the procedure for that?
144
145 Yes. I'll tell you exactly what I did after recreating the boot
146 partition, then perhaps you can figure out if and where I went wrong.
147
148 First, I booted to the Gentoo install CD. I'm still using the 2006.1,
149 but I don't figure that makes a difference 'cause all the files get
150 updated anyway and I do a network install the get the snapshots, etc.
151
152 2) For some reason my network device is never automatically detected
153 when the install CD boots, so I have to run 'net-setup eth0' and then
154 I'm fine. I checked network connectivity.
155
156 3) I mounted the following:
157 mount /dev/sda3 /mnt/gentoo
158 mount /dev/sda1 /mnt/gentoo boot
159 This was after I had recreated the boot partition and created the file
160 system on it.
161
162 4) I skipped ahead 'cause I didn't need to install the base system or
163 portage - the files are all there when I do 'ls /mnt/gentoo/'
164
165 Then, I did:
166
167 mount -t proc none /mnt/gentoo/proc
168 mount -o bind /dev /mnt/gentoo/dev
169
170 chroot /mnt/gentoo /bin/bash
171 env-update
172 source /etc/profile
173
174 At this point, you would normally do an 'emerge --sync', but I didn't
175
176 I *did* do 'ls -FGg /etc/make.profile and it returned the expected
177
178 5) I did the step:
179
180 zcat /proc/config.gz > /usr/share/genkernel/x86/kernel-conf-2.6
181
182 The ran 'genkernel --menuconfig all'
183
184 6) Then I did the grub stuff
185
186 emerge grub
187 created grub.conf
188
189 'grep -v rootfs /proc/mounts > /etc/mtab
190
191 grub-install /dev/sda
192
193 As previously stated, grub installed in the correct place (sda1)
194
195 7) The I exited and unmounted the mounted partitions and rebooted.
196
197 >
198 > What was your partition layout before this mistake happened? If you can
199 > remember how many partitions you had, their size, the order they were
200 > in and where they were mounted, that info would be useful.
201
202 This is/was my partition scheme and the output of fdisk -l. The only
203 one I messed with today was the first one:
204
205 Disk: /dev/sda
206 100.0 GB 100030242816 bytes
207 255 heads 63 sectors/track
208 12161 cylinders
209 Units=cylinders of 16065*512=8225280 bytes
210
211
212 Device Boot Start End Blocks ID System
213
214 /dev/sda1 * 1 17 136552 83 Linux
215 /dev/sda2 18 516 4008217+ 82 Linux swap / Solaris
216 /dev/sda3 517 5380 3900080 83 Linux
217 /dev/sda4 5381 121161 54468382+ 83 Linux
218
219
220 >
221 > The contents of your /etc/fstab and /boot/grub/grub.conf
222
223 Will send this later if you still think you need it after reading this
224 >
225 > The output of 'fdisk -l /dev/sda'
226
227 See above
228 >
229 > The output of e2fsck, run on each of your filesystems
230 >
231 e2fsck for both sda1 (boot) and sda4 (home) come back clean
232
233 Output from e2fsck for /dev/sda3 is:
234
235 Pass
236 1 Checking inodes, blocks and sizes
237 2 Checking Directory Structure
238 3 Checking Directory connectivity
239 4 Checking Reference counts
240 5 Checking Summary information
241
242 /dev/dsa3: 437650/4889248 files (4.3% non-contiguous) 2203865/9767520 blocks
243
244 I supposed if worse comes to worse, I can resintall /dev/sda3 - my home
245 partition would remain intact on /dev/sda4
246
247 Anyway, let me know what else you need (besides maybe contents of fstab
248 and grub.conf
249
250 Although the fstab and grub.conf are exactly what they were before
251 hitting that damned "Media Direct" button.
252
253 Regards,
254
255 Colleen
256
257
258 --
259
260 Registered Linux User #411143 with the Linux Counter, http://counter.li.org
261 --
262 gentoo-user@g.o mailing list

Replies

Subject Author
Re: [gentoo-user] Boot situation Alan McKinnon <alan@××××××××××××××××.za>
Re: [gentoo-user] Boot situation Benno Schulenberg <benno.schulenberg@×××××.com>