# boot problem. stuck at post.



## clone (Aug 4, 2005)

hi. i'm not sure if this is the right forum to post my problem. please move it to the right one if its not.

i have 2 harddisk in my pc. i run crunchbang from the first and lmde from the second. 
i decided to change lmde to another os so i use gparted to shrink the lmde partition from 5gb to 4gb and use the free 1gb as swap. after the process is done in gparted everything is working fine. 

then i restarted the pc and problem starts.
during post, the pc detects my 1st hardisk with crunchbang, than the 2nd with lmde but it stops there. display shows primary master detected, primary slave detected, and reads correctly the model of both harddisks. then stops. keyboard still works, i can press caps lock or num lock. if i press delete it says entering setup but it just wont enter.

if i take out the 2nd harddisk, the system works fine again. if i take out the 1st harddisk and leave the 2nd, the same problem occurs which is the display freezes after detecting the harddisk. basically when the 2nd harddisk is connected to the system i can't get past post. i cannot even enter setup.

i guess the problem starts after i shrinked the lmde partition. is it okay to shrink a partition at the beginning of a harddisk when there are other partitions after that?

i hope i explained the problem clearly enough for anyone reading. i'll gladly post any other info if required.

help please... thanks


----------



## lotuseclat79 (Sep 12, 2003)

Hi clone,

We need you to describe your original installation in a bit more detail.

First, assuming that you had a dual-boot setup: Is that what you had for your two disk installation with (crunchbang, imde) - i.e. the Crunchbang Linux and Linux Mint DE - what versions were they?

What boot loader did you have: lilo, grub or grub2?

Did you ever save any data about either disk's configuration, e.g. using the fdisk -l or fdisk -lu commands? If so, what did the output look like please post it in this thread.

Also, usually, one of the two disks in a dual boot setup (which allows either OS to boot up via user selection) has a boot partition on one of the disks for the other disk's OS which is usually chained in the boot menu.lst file.

Normally, a single disk with one OS on it has a Master Boot Record (MBR) occupying the first 1024 (2 sectors) of the hard disk which contains a link to the bootloader for the OS, and a partition table for the disk - so, I'm guessing if you messed with the lmde disk's MBR at the start of the 2nd disk - then that is what caused your problems.

Do you have a backup of each of your disks? If so, then you could restore the old configuration of the 2nd disk which worked before you changed its partition configuration.

What I suggest you do, is take out the lmde disk since the system works fine without it. Then look at the menu.lst file in the boot directory of the crunchbang disk. Post it and any saved files (such as fdisk -l or fdisk -lu) for both disks so we can see what the original configuration of the 2nd disk was - if you have it.

-- Tom


----------



## clone (Aug 4, 2005)

hi tom. thanks for the reply.

to answer your questions, a bit more detail about my installation:
from sudo fdisk -l:

Disk /dev/sda: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x003e003d

Device Boot Start End Blocks Id System
/dev/sda1 * 1 829 6658911 7 HPFS/NTFS (windows xp installation)
/dev/sda2 830 4866 32423011 f W95 Ext'd (LBA)
/dev/sda5 830 3570 22017051 7 HPFS/NTFS (for data)
/dev/sda6 3571 3962 3148708+ 83 Linux (crunchbang installation) 
/dev/sda7 3963 4093 1052226 82 Linux swap / Solaris
/dev/sda8 4094 4485 3148708+ 83 Linux (/home directory) 
/dev/sda9 4486 4866 3054592 7 HPFS/NTFS (for data)

right now my 2nd harddisk in not connected but here's how it looks like.
/dev/sdb is an 80gb disk:

sdb1 - lmde installation 4gb
unallocated partition 1gb
sdb5 - ntfs data for the rest

my bootloader is grub2. i actually have grub2 on both harddisks so i can boot either one if i take out the other and both work fine before this problem started.

could the mbr in /dev/sdb be corrupted after i shrinked the lmde partition (sdb1) from 5gb to 4gb? i wanted the extra 1 gb for swap. but even so wouldn't it at least let me get into bios?

i do have a clonezilla backup of sdb1. but since i already shrinked the partition size, do you think if i grow it back to 5gb and restore the backup, all will be well again?

1 update on this situation. if i connect /dev/sdb to the ide cable on secondary slave for example, during boot the post message will detect the disk on secondary slave then just freezes there and i cannot even get into bios. 
but if i set in bios to NOT read from secondary slave, then during post it wont detect the disk but the boot process will carry on into grub. in grub i cannot choose lmde (because the disk is not detected) but i can choose crunchbang. and here's the kicker: when i'm in crunchbang i can access both harddisks. i can open sdb1 and sdb5.

so basically, if the 2nd harddisk is detected in bios, boot process will hang during post.
if its NOT detected in bios, boot process will go on normally and when i'm inside crunchbang i can access the 2nd harddisk.

i feel like my explanation is too long and complicated. please bear with me.
thank you.


----------



## lotuseclat79 (Sep 12, 2003)

Hi clone,

Your post is not too long or complicated.

It is a good thing you can access your disks when setting the BIOS to not read from secondary slave.

If you have Disk Utility on Crunchbang, use it to check out the partitions (if possible) on the lmde disk. Try the fdisk -l and/or fdisk -lu commands from the root account on Crunchbang to see if you get any data on the lmde disk (connected).

I'm guessing that your best bet is as you mentioned, i.e. regrow the sdb1 partition back to its original size, and then restore the clonezilla backup.

Hopefully, then all will work as before after you reset the Bios to its original state.

-- Tom


----------



## saikee (Jun 11, 2004)

I don't think the MBR is corrupted in this case.

The Grub works by activating the stage1 in the MBR. Then the stage1 will load the stage2, which is the intelligent bits, into the memory. It does so by going directly to the hard disk position of stage2. If the user shrink the partition that hold stage2, which is the part holding /boot, then the hard disk address of the stage2 would be no longer valid, resulting a broken Grub.

Grub2 officially does not have stage1 and stage2 but in effect it has the similar two portions. The stage1 must be small enough to fit inside the MBR and its only function is to load stage2.

The problem can be cured by booting up a Linux with Grub2, either from a hard disk or from a CD, and reconnect the Grub2.

For sample if the original Grub2 is in sdb1 and the MBR of sda is in the control then this command in root (or prefix with sudo if it is a member of Ubuntu family) should cure it

```
mkdir /mnt/sdb1
mount /dev/sdb1 /mnt/sdb1
grub-install --root-directory=/mnt/sdb1 /dev/sda
```
If the Linux in sdb1 (say) is boot indirectly by another Linux or a MS boot loader then the reconnection should be to device /sdb1 as follow

```
mkdir /mnt/sdb1
mount /dev/sdb1 /mnt/sdb1
grub-install --root-directory=/mnt/sdb1 --force /dev/sdb1
```
The difference between the two is in the former case Linux sdb1 is fired up immediately after POST. In the Latter another operating system is booted first and sdb1 would only booted as one of the available system when selected.


----------



## clone (Aug 4, 2005)

hi saikee. thanks for chipping in.
I'm actually away for a bit right now so I can't follow all the suggestion just yet. I'll definitely get back to you guys in a few days when I can sit in front of the computer.

I should tell that I've tried reformatting and installing a new crunchbang on sdb1. All went went in the beginning but it got stuck during the actual installing data on disk part. Seemed like it went ok but when I try to proceed to the next part which is installing grub, it just went back to the previous part. It keeps repeating. 
Thats it for now. I'll be back in a few days.


----------



## clone (Aug 4, 2005)

halo. i'm back again.

tom:
i had Disk Utility in lmde but not in crunchbang. so cannot use that since theres no more installed lmde. does it provide any additional info that i cannot get from gparted? and right now i'm hesitant to resize the partitions just because i don't want to screw up anything further. resizing was what got me here in the 1st place i think. haha

saikee:
i thought about your suggestion to reinstall grub. but i've always used grub in sda and its always worked fine. its still working right now. but if i install grub in /dev/sdb would it affect grub in sda in case i have to revert back to original?

could the partition table for sdb got corrupted after i shrinked sdb1? corrupted to the point that i can't even get past post on boot?


----------



## clone (Aug 4, 2005)

another update.

i finally got this system to read properly from sdb. now i can boot with the sdb disk connected properly, i can access the files on the disk normally, fdisk reads the partition fine and even gparted can read the disk fine. it took a long and mind numbing process involving Testdisk, Sfdisk and gparted. i painfully managed to get something going through google and various forums including this one of course.

right now i'm just too sleep deprived to go into details but i'll come back later/in a few days and post the steps i took. next is to actually try and install a new OS on sdb1 and hope everything goes well. 

thanks again tom and saikee for taking the time.


----------



## clone (Aug 4, 2005)

hi again. so here was what i did.

my original problem, getting stuck at post. i fixed that by using Testdisk to change the partition table. testdisk showed that the extended partition on sdb was a bit messed up so i fixed it. than i could boot properly.

after that i found out that i couldn't see the harddisk sdb in gparted. it showed the whole disk as unallocated. the error message "Can't have a partition outside the disk!" comes up in the information box under properties. but if i used fdisk -l in the terminal, the partitions came up properly. after searching around i found out about sfdisk. this page shed some light on the matter: http://www.rodsbooks.com/missing-parts/index.html. after reading that and some other searches, i used sfdisk to fix it and all was ok. now i can boot properly with sdb, gparted can open the disk properly and i can access all the data inside.

now to actually install a new os. this is already getting into a different topic than my original post but i'll just continue anyway. i wanted to try out the new crunchbang statler 20111125. at first i couldn't boot the live cd so i try it out on a different pc and it worked fine so the iso image or cd wasn't the problem. i tried to install anyway and surprisingly it went fine.

now i reboot the pc into the new os and problem. i can get into grub and choose the right os. then it gets stuck at "waiting for /dev to be fully populated...". this was also where the live cd got stuck during boot. after some googling i found someone that said it could be a case of the new crunchbang kernel not able to read old hardware. could that be the case? i have a pentium 4 2.0Ghz and 512mb ddr400 ram.

so that's it if anyone is interested. maybe i should post a new topic for my current problem.

thanks tom and saikee for your time.


----------

