Looks like i had to solve this by my self, again.
System is working know after taking a closed look at he the boot process to first, understand what is wrong so i know where to "attack" and second fix the problem since "format and reinstall" is not a option.
This is my problem, my old board broke down and I change it with a different new one, since linux was not working I've installed windows XP on a spare partition to keep on working until i had some time to solve this. Since Grub is gone because of windows we had to do a very complex, time consuming recover of the system.
It's kind of a complex solution..... so.... first of all boot you CD/DVD in rescue mode without network and chroot to it:
Code:
chroot /mnt/sysimage
Now is the hard part, try to keep it up
# Dude! Where is my pendrive?
Code:
[root@dragon]# blkid
/dev/sdb1: UUID="A2E2ACB2E2AC8BDB" LABEL="Dados" TYPE="ntfs"
/dev/sda8: LABEL="/" UUID="3094c537-bc2a-4a9e-8e97-30dffe802896" SEC_TYPE="ext2" TYPE="ext3"
/dev/sda1: UUID="E6D8E6B2D8E67FE3" LABEL="WIN2003" TYPE="ntfs"
/dev/sda5: LABEL="SWAP" UUID="7C2F-48E0" TYPE="vfat"
/dev/sda6: LABEL="/boot" UUID="f86bff6f-31f8-4eca-bbee-4e0bfb694397" SEC_TYPE="ext2" TYPE="ext2"
/dev/sda7: TYPE="swap" LABEL="SWAP-sda7" UUID="de033a40-d028-43e5-b246-f629fba30d29"
/dev/sda9: UUID="a7286624-a557-4665-946b-1275cf960bf4" SEC_TYPE="ext2" TYPE="ext3"
/dev/sdc1: SEC_TYPE="msdos" LABEL="2GPEN" UUID="4876-31F3" TYPE="vfat"
/dev/sr0: LABEL="Fedora 9 x86_64 DVD" TYPE="iso9660"
Our pendrive is
/dev/sdc1.
Now is time to get ready to put our pendrive in good use:
# Backup the thing
Code:
dd if=/dev/sdc of=pendrive_backup.img
# Format
Code:
mkfs.ext3 -v /dev/sdc
# Make some partitions on it, on my 2GB pendrive i've set 1GB for windows use and another 1GB for linux, 1GB is too much for now but you can use the space for some backup or what ever you want.
Code:
fdisk /dev/sdc
Device contains neither a valid DOS partition table, nor Sun, SGI or
OSF disklabel
Building a new DOS disklabel with disk identifier 0x6011d2ff.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): p
Disk /dev/sdc: 2028 MB, 2028994560 bytes
63 heads, 62 sectors/track, 1014 cylinders
Units = cylinders of 3906 * 512 = 1999872 bytes
Disk identifier: 0x6011d2ff
Device Boot Start End Blocks Id System
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1014, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1014, default 1014): +2018M
Command (m for help): p
Disk /dev/sdc: 2028 MB, 2028994560 bytes
63 heads, 62 sectors/track, 1014 cylinders
Units = cylinders of 3906 * 512 = 1999872 bytes
Disk identifier: 0x6011d2ff
Device Boot Start End Blocks Id System
/dev/sdc1 1 1010 1972499 83 Linux
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (1011-1014, default 1011):
Using default value 1011
Last cylinder or +size or +sizeM or +sizeK (1011-1014, default 1014):
Using default value 1014
Command (m for help): p
Disk /dev/sdc: 2028 MB, 2028994560 bytes
63 heads, 62 sectors/track, 1014 cylinders
Units = cylinders of 3906 * 512 = 1999872 bytes
Disk identifier: 0x6011d2ff
Device Boot Start End Blocks Id System
/dev/sdc1 1 1010 1972499 83 Linux
/dev/sdc2 1011 1014 7812 83 Linux
Command (m for help): t
Partition number (1-4): 1
Hex code (type L to list codes): 6
Changed system type of partition 1 to 6 (FAT16)
Command (m for help): p
Disk /dev/sdc: 2028 MB, 2028994560 bytes
63 heads, 62 sectors/track, 1014 cylinders
Units = cylinders of 3906 * 512 = 1999872 bytes
Disk identifier: 0x6011d2ff
Device Boot Start End Blocks Id System
/dev/sdc1 1 1010 1972499 6 FAT16
/dev/sdc2 1011 1014 7812 83 Linux
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: If you have created or modified any DOS 6.x
partitions, please see the fdisk manual page for additional
information.
Syncing disks.
# Doing what the 'WARNING' said to do, read the man page of fdisk.
Code:
dd if=/dev/zero of=/dev/sdc1 bs=512 count=1
1+0 records in
1+0 records out
512 bytes (512 B) copied, 0.0121442 s, 42.2 kB/s
# Creating a filesystem for eatch partition.
Code:
mkdosfs -F 16 -n "WTUPEN" /dev/sdc1
mke2fs -L "GRUBPEN" /dev/sdc2
# Mount the /dev/sdc2 some place else with:
Code:
mount -t ext2 /media/GRUBPEN
# Making the base directories and copying some grub files on it
Code:
mkdir -p /media/GRUBPEN/boot/grub
cp stage1 stage2 menu.lst grub.conf /media/GRUBPEN/boot/grub
# Installing Grub
Code:
grub-install --no-floppy --root-directory=/media/GRUBPEN /dev/sdc2
Probing devices to guess BIOS drives. This may take a long time.
Installation finished. No error reported.
This is the contents of the device map /media/GRUBPEN/boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.
(hd0)/dev/sda
(hd1) /dev/sdb
(hd2) /dev/sdc
This part is done, now boot your pendrive, select your kernel and let it boot. In my system i see a error like 'partition not found', press ESQ, press 'e' to edit the line and change this:
To this:
Press 'ENTER' and 'b' to boot, soon after the system will get the nice error i've asked help for:
Code:
Loading pata_amd module
Waithing for driver initialization.
Trying to resume from device (/dev/sda7)
Unable to access resume device (/dev/sda7)
Creating root device.
Mounthing root filesystem.
mount: could not find filesystem '/dev/root'
Setting up other filesystems.
Setting up new root fs
setuproot: moving /dev failed: No such file or directory
no fstab.sys, mounting internal defaults
setuproot: error mounting /proc: No such file or directory
setuproot: error mounting /sys: No such file or directory
Mount failed for selinuxfs on /selinux: No such file or directory
Switching to new root and running init.
unmounting old /dev
unmounting old /proc
unmounting old /sys
switchroot: mount failed: No such file or directory
Booting has failed
Since the system had passed the
Start UP > Stage 1 Bootloader > Stage 2 Bootloader > Kernel stage, it never gets to 'init' part because linux is not able to mount any partition:
http://www.ibm.com/developerworks/li...y/l-linuxboot/
If linux is not getting any info from the partitions, the error is located some place else attached to kernel, it's not System.map because inside there are only symbols, so is the initrd file.
http://en.wikipedia.org/wiki/Initrd
The initial ramdisk, or initrd is a temporary file system commonly used by the Linux kernel during boot. The initrd is typically
used for making preparations before the real root file system can be mounted.
And there we go....
Code:
[root@dragon ~]# cd /boot
[root@dragon boot]# mkdir tmp
[root@dragon boot]# cp initrd-2.6.25.11-97.fc9.x86_64.img tmp
[root@dragon boot]# cd tmp
[root@dragon tmp]# gzip -dc /boot/initrd-2.6.25.11-97.fc9.x86_64.img | cpio -id
14333 blocks
[root@dragon tmp]# vi init
skipping the boring part...
echo "Loading sata_nv module"
modprobe -q sata_nv
The part in red is the problem, we don't need it anymore.
This is how we do it:
Code:
[root@dragon ~]# cd /boot
[root@dragon boot]# mv initrd-2.6.25.11-97.fc9.x86_64.img initrd-2.6.25.11-97.fc9.x86_64.old
[root@dragon boot]# mkinitrd initrd-2.6.25.11-97.fc9.x86_64.img 2.6.25.11-97.fc9.x86_64
This will solve the problem because the new initrd will have the working module that we need, now to finish the job 100% we need to recover Grub since the Windows installation messed that up, this is hard work so, pay attention.