LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (http://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   removed 2 hard drives, not /, error 'corrupt partition table' on reboot (http://www.linuxquestions.org/questions/linux-hardware-18/removed-2-hard-drives-not-error-corrupt-partition-table-on-reboot-628308/)

gr8scot 03-15-2008 05:02 PM

removed 2 hard drives, not /, error 'corrupt partition table' on reboot
 
Debian Etch, AMD64

I think I found the answer in 'man fdisk' but want to confirm before opening & un-plugging: will editing /proc/partitions, commenting out the 2 hard drives I want to remove, solve this problem, which prevents reboot until I reconnect these two hard drives? Thanks!

gr8scot 03-15-2008 05:32 PM

Oh, and of course I'll have to edit /etc/fstab also
 
That was the *only* thing I did previously before shutting down & unplugging the unwanted hard drives earlier. To clarify my question, is editing /proc/partitions the *only* other thing I need to do? Thanks again.

jailbait 03-15-2008 05:40 PM

Quote:

Originally Posted by gr8scot (Post 3089806)
That was the *only* thing I did previously before shutting down & unplugging the unwanted hard drives earlier. To clarify my question, is editing /proc/partitions the *only* other thing I need to do? Thanks again.

You need to comment out any entries in /etc/fstab for the removed partitions. I doubt that editing /proc/partitions has any effect one way or the other.

------------------
Steve Stites

osor 03-15-2008 05:47 PM

Quote:

Originally Posted by gr8scot (Post 3089806)
editing /proc/partitions

You canít edit /proc/partitions (at least not in the usual sense). It is a dynamically generated file, which gives all the partitions that are mounted in the kernel each time it is read. Writing to /proc/partitions has no effect since there is no write-handler (in fact it should not even be writable).

gr8scot 03-16-2008 12:29 AM

In that case, I have a problem.
 
Quote:

Originally Posted by osor (Post 3089815)
You can't edit /proc/partitions (at least not in the usual sense). It is a dynamically generated file, which gives all the partitions that are mounted in the kernel each time it is read. Writing to /proc/partitions has no effect since there is no write-handler (in fact it should not even be writable).

I did comment out the lines in fstab for the drives I want to remove, the first time I tried removing them. On reboot I encountered an error message, "corrupt partition table" and could not proceed except by re-connecting the IDE drives, which I'd like to transfer to another system. Has anybody else encountered a problem like this? It's easy to find a Linux How-To on installing hard drives, but Google returns no info (that I've noticed) about removing them. :-(

gr8scot 03-16-2008 12:32 AM

Quote:

Originally Posted by jailbait (Post 3089812)
You need to comment out any entries in /etc/fstab for the removed partitions. I doubt that editing /proc/partitions has any effect one way or the other.

------------------
Steve Stites

Maybe I just need to umount them before I shutdown -h now. Would that cause /proc/partitions to be updated dynamically so that I could reboot without the unwanted drives?

osor 03-16-2008 01:34 PM

Quote:

Originally Posted by gr8scot (Post 3090036)
Would that cause /proc/partitions to be updated dynamically so that I could reboot without the unwanted drives?

The state of a procfile before boot does not affect its state on a new boot. When the computer shuts down, the proc filesystem disappears (POOF!).
Quote:

Originally Posted by gr8scot (Post 3090035)
On reboot I encountered an error message, "corrupt partition table" and could not proceed except by re-connecting the IDE drives, which I'd like to transfer to another system.

What this seems like to me is that your boot partition or the bootloader is on the drive you are removing. The other drive has no bootloader. What you should do in this case is copy any files needed for booting (e.g., kernel images) to the other drive, and then install your bootloader on that drive.

gr8scot 03-16-2008 08:55 PM

Quote:

Originally Posted by osor (Post 3090423)
The state of a procfile before boot does not affect its state on a new boot. When the computer shuts down, the proc filesystem disappears (POOF!).

What this seems like to me is that your boot partition or the bootloader is on the drive you are removing. The other drive has no bootloader. What you should do in this case is copy any files needed for booting (e.g., kernel images) to the other drive, and then install your bootloader on that drive.

That seems like what I would guess too, but I don't see how that could happen:

~cat /etc/fstab
# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
# none /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
/dev/sda1 / ext3 defaults,errors=remount-ro 0 1
/dev/hdc1 /media/hdc ext3 defaults,data=writeback 0 2
/dev/hdd1 /media/hdd ext3 defaults,data=writeback 0 2
/dev/sdb1 /media/sdb ext3 defaults,data=writeback 0 2
/dev/sda5 none swap sw 0 0
/dev/hda /media/cdrom0 udf,iso9660 user,noauto 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto 0 0

/dev/sda1 = /, which is the disk I'm leaving alone. I want to remove /dev/hdc, /dev/hdd and maybe /dev/sdb, all of which are "safely" mounted under /media, so I don't see how any of my boot partition could have gotten onto any of those drives. And the boot loader is where it belongs; I get the 'partition tables' error message after hitting Enter in Grub to boot my recently-compiled kernel.

osor 03-16-2008 09:47 PM

You might have two bootloaders installed (one on hdc and one on sda), but only one is working. Or maybe itís something completely different.

What is the output of:
Code:

fdisk -l
Also, is there any similar output in dmesg when you happen to boot correctly? Lastly, please post the exact error message (and some context preceding it).

gr8scot 03-17-2008 12:49 AM

fdisk & dmesg
 
Quote:

Originally Posted by osor (Post 3090794)
You might have two bootloaders installed (one on hdc and one on sda), but only one is working. Or maybe itís something completely different.

What is the output of:
Code:

fdisk -l
Also, is there any similar output in dmesg when you happen to boot correctly? Lastly, please post the exact error message (and some context preceding it).

Code:

fdisk -l
Disk /dev/hdc: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdc1 1 38913 312568641 83 Linux

Disk /dev/hdd: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdd1 1 38913 312568641 7 HPFS/NTFS

Disk /dev/sda: 150.0 GB, 150039945216 bytes
255 heads, 63 sectors/track, 18241 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 17495 140528556 83 Linux
/dev/sda2 17496 18241 5992245 5 Extended
/dev/sda5 17496 18241 5992213+ 82 Linux swap / Solaris

Disk /dev/sdb: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 38913 312568641 7 HPFS/NTFS


dmesg does not contain the word 'partition' on successful boot, and nothing applicable about any 'table.' Plenty about TCP & IP hash tables, and some CPU hash tables, though.

For the *exact* wording of the error message, I'll have to wait until at least tomorrow to reboot, but it occurs immediately after selecting a kernel to boot from GRUB. I have left the originally installed 2.6.18 kernel, three subsequent security updates from Debian, and the one I just compiled a few weeks ago. The error occurs regardless of which kernel I try to boot, which is no surprise as far as I know, but for all I know might be relevant after all.

It would be really nice if that "Device Boot" reported by fdisk -l tells you the problem. This is much deeper into the boot sequence than I've ever gotten before, and I feel completely lost.

Thanks for your help.

gr8scot 03-18-2008 08:39 PM

exact error message when I re-booted:
 
Quote:

Booting 'Debian GNU/Linux kernel 2.6.18_x86-64 Default'

root (hd2,0)

Error 5: Partition table invalid or corrupt

Press any key to continue ...
I think the problem is described in 'root (hd2,0)' but I don't know what to make of it, except that it looks like something is looking for some data on one of my removed IDE drives instead of on the SATA boot device.

jailbait 03-18-2008 08:54 PM

Quote:

Originally Posted by gr8scot (Post 3093283)
I think the problem is described in 'root (hd2,0)' but I don't know what to make of it, except that it looks like something is looking for some data on one of my removed IDE drives instead of on the SATA boot device.

grub numbers drives in relative order. The first hard drive it encounters is hd0, the second is hd1, the third is hd2. So in removing two drives and/or rearranging the drives the original hd2 may no longer be called hd2 by grub. You may have to go through /boot/grub/menu.lst and change all of its hdx parameters to reflect the new hard drive order.

-----------------------
Steve Stites

gr8scot 03-19-2008 12:54 AM

Quote:

Originally Posted by jailbait (Post 3093291)
grub numbers drives in relative order. The first hard drive it encounters is hd0, the second is hd1, the third is hd2. So in removing two drives and/or rearranging the drives the original hd2 may no longer be called hd2 by grub. You may have to go through /boot/grub/menu.lst and change all of its hdx parameters to reflect the new hard drive order.

-----------------------
Steve Stites

Cute that it uses a different nomenclature from /etc/fstab!!

OK, I'm changing the line
Quote:

root (hd2,0)
to
Quote:

root (sd1,0)
and I think it will work. If it doesn't, I'll have to whine about it from a different computer!

gr8scot 03-19-2008 01:09 AM

closed
 
menu.lst doesn't differentiate SATA from IDE at all, so instead of sd#,0 the correct edit was hd0,0.

Thanks, jailbait!


All times are GMT -5. The time now is 02:07 AM.