LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 03-15-2008, 04:02 PM   #1
gr8scot
Member
 
Registered: Jun 2007
Distribution: Debian, kubuntu
Posts: 73

Rep: Reputation: 16
Question 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!
 
Old 03-15-2008, 04:32 PM   #2
gr8scot
Member
 
Registered: Jun 2007
Distribution: Debian, kubuntu
Posts: 73

Original Poster
Rep: Reputation: 16
Talking 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.
 
Old 03-15-2008, 04:40 PM   #3
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,336

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
Quote:
Originally Posted by gr8scot View Post
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
 
1 members found this post helpful.
Old 03-15-2008, 04:47 PM   #4
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 78
Quote:
Originally Posted by gr8scot View Post
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).
 
Old 03-15-2008, 11:29 PM   #5
gr8scot
Member
 
Registered: Jun 2007
Distribution: Debian, kubuntu
Posts: 73

Original Poster
Rep: Reputation: 16
Unhappy In that case, I have a problem.

Quote:
Originally Posted by osor View Post
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. :-(
 
Old 03-15-2008, 11:32 PM   #6
gr8scot
Member
 
Registered: Jun 2007
Distribution: Debian, kubuntu
Posts: 73

Original Poster
Rep: Reputation: 16
Question

Quote:
Originally Posted by jailbait View Post
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?
 
Old 03-16-2008, 12:34 PM   #7
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 78
Quote:
Originally Posted by gr8scot View Post
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 View Post
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.
 
1 members found this post helpful.
Old 03-16-2008, 07:55 PM   #8
gr8scot
Member
 
Registered: Jun 2007
Distribution: Debian, kubuntu
Posts: 73

Original Poster
Rep: Reputation: 16
Unhappy

Quote:
Originally Posted by osor View Post
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.
 
Old 03-16-2008, 08:47 PM   #9
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 78
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).
 
1 members found this post helpful.
Old 03-16-2008, 11:49 PM   #10
gr8scot
Member
 
Registered: Jun 2007
Distribution: Debian, kubuntu
Posts: 73

Original Poster
Rep: Reputation: 16
Thumbs up fdisk & dmesg

Quote:
Originally Posted by osor View Post
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.
 
Old 03-18-2008, 07:39 PM   #11
gr8scot
Member
 
Registered: Jun 2007
Distribution: Debian, kubuntu
Posts: 73

Original Poster
Rep: Reputation: 16
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.
 
Old 03-18-2008, 07:54 PM   #12
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,336

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
Quote:
Originally Posted by gr8scot View Post
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
 
1 members found this post helpful.
Old 03-18-2008, 11:54 PM   #13
gr8scot
Member
 
Registered: Jun 2007
Distribution: Debian, kubuntu
Posts: 73

Original Poster
Rep: Reputation: 16
Thumbs up

Quote:
Originally Posted by jailbait View Post
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!
 
Old 03-19-2008, 12:09 AM   #14
gr8scot
Member
 
Registered: Jun 2007
Distribution: Debian, kubuntu
Posts: 73

Original Poster
Rep: Reputation: 16
closed

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

Thanks, jailbait!
 
  


Reply

Tags
boot, corrupt, drive, hard, hardware, partition, remove, table, tables, uninstall



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Why new SCSI hard disk's partition table was reset after reboot? linux94118 Linux - Hardware 2 11-16-2007 09:58 PM
"partition table too corrupt for me"- error diabolus Mandriva 4 05-28-2004 03:07 AM
corrupt partition table Verso Linux - Hardware 5 12-16-2003 10:23 AM
Corrupt Partition Table BigBadPenguin Linux - Hardware 3 09-02-2003 11:02 AM
Corrupt partition table mback Linux - Software 3 04-27-2002 11:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 12:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration