LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 06-03-2004, 12:23 PM   #1
gackt3541
LQ Newbie
 
Registered: Jun 2004
Posts: 4

Rep: Reputation: 0
Restore Grub Help


I reinstall my Winxp as NTFS Yesterday, and i get this error when i boot in to linux by Cd-Rom boot .

RedHat 8.09
cdrom -- linux boot

#chroot /mnt/sysimage
chroot:cannot change root directory to /mnt/sysimage:No such file or directory No such device

#fdisk -l
/dev/hda1 * Fat32
/dev/hda2 Ext'd
/dev/hda5 Fat32
/dev/hda6 NTFS
/dev/hda7 Linux
/dev/hda8 Linux Swap
/dev/hda9 Linux
------------------------------------------------------
I can't view my /etc/fstab because can't change root directory and mount the hda7.

It seems the Winxp installation have destroyed my linux ......

-_-

Anyone can help me ?
Thank you so much

Sorry about my poor English
 
Old 06-03-2004, 02:10 PM   #2
rose_bud4201
Member
 
Registered: Aug 2002
Location: St Louis, MO
Distribution: Xubuntu, RHEL, Solaris 10
Posts: 927

Rep: Reputation: 30
Boot from a linux bootdisk, prefererably one which will allow you to chroot to your root linux directory. Tom's Boot Disk is a good one. I'm unsure of the mechanics of booting from a cdrom, but once you get your partitions mounted you could look around and see what's missing...

cool,
Laura
 
Old 06-04-2004, 03:22 AM   #3
marghorp
Senior Member
 
Registered: Jan 2004
Location: Slovenia
Distribution: Slackware 10.1, SLAX to the MAX :)
Posts: 1,040

Rep: Reputation: 45
Try to see if your partitions have ben mounted. do a simple: mount
That should print the partitions that are mounted and where they are mounted. If your linux partition isn+t mounted anywhere, just mount it yourself.

For example:

fdisk -l

Should print out all the partitions you have. Try to identify the one that your linux (/ root partition) is on. Identify it by size, or by elimination. If oyu know which partition it is on and what type of filesystem it is, even better.

Then just:

mkdir /mylinux
mount -t ext3 /dev/hda1 /mylinux

Change the ext3 to your / (root) filesystem type and /dev/hda1 to the partition you found from fdisk -l.

Then if all goes well and there is no output from the above mount command chroot to /mylinux:

chroot /mylinux

Once there you can use your linux partition as if you were on it.

/sbin/grub-install /dev/hda

This will install grub in MBR and it will come up again after reboot.

Good luck!

Peace!
 
Old 06-06-2004, 06:40 AM   #4
gackt3541
LQ Newbie
 
Registered: Jun 2004
Posts: 4

Original Poster
Rep: Reputation: 0
Thank you for the reply


Disk /dev/hda: 20.4 GB, 20491075584 bytes
255 heads, 63 sectors/track, 2491 cylinders, total 40021632 sectors
Units = sectors of 1 * 512 = 512 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 63 6152894 3076416 b Win95 FAT32
/dev/hda2 6152895 40017914 16932510 f Win95 Ext'd (LBA)
/dev/hda5 6152958 26635769 10241406 b Win95 FAT32
/dev/hda6 26635833 33334874 3349521 7 HPFS/NTFS
/dev/hda7 33334938 33543719 104391 83 Linux (BOOT)
/dev/hda8 33543783 34587944 522081 82 Linux swap
/dev/hda9 34588008 40017914 2714953+ 83 Linux (/)

Disk /dev/hdb: 6498 MB, 6498680832 bytes
255 heads, 63 sectors/track, 790 cylinders, total 12692736 sectors
Units = sectors of 1 * 512 = 512 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 16065 12691349 6337642+ 5 Extended
/dev/hdb5 16128 8048564 4016218+ b Win95 FAT32
/dev/hdb6 8048628 12691349 2321361 b Win95 FAT32

mkdir /mylinux
mount -t ext3 /dev/hda7 /mylinux

It work !
But i can't mount the /dev/hda9
#mount : special device /dev/hda9 does not exist.

It seems /dev/hda9 was corrupted!!

How can i check the device is health or not ?
Any command ??

Really Thank you Very much !
^!^
 
Old 06-06-2004, 06:57 AM   #5
marghorp
Senior Member
 
Registered: Jan 2004
Location: Slovenia
Distribution: Slackware 10.1, SLAX to the MAX :)
Posts: 1,040

Rep: Reputation: 45
the command you are looking for is:

fsck -t ext3 /dev/hda9

This should work for you if you have ext3 filesystem. Does anyone know how to check the filesystem of a partiiton? Maybe check /etc/fstab, it might give you some usefull info on that. Search for the line /dev/hda9 and see what filesystem it is, unless you know what it is, in which case you can fsck it to see whether it is healthy

Good luck! Peace!
 
Old 06-06-2004, 08:28 AM   #6
gackt3541
LQ Newbie
 
Registered: Jun 2004
Posts: 4

Original Poster
Rep: Reputation: 0
Thx

I try fsck -t ext3 /dev/hda9.

WARNING:Couldn't open /etc/fstab:No such file or dir
e2fsck :Attempt to read block from filesystem resulted in short read while trying to open /dev/hda9
Counld this be a zero-length partition?

oh...^_^
What can i do ?

Thank you ^!^
 
Old 06-06-2004, 09:07 AM   #7
wmakowski
Member
 
Registered: Oct 2003
Location: Ohio
Distribution: Fedora 18, 19, RHL 5.2
Posts: 546

Rep: Reputation: 43
If your root directory is mounted as /mylinux then the fsck command can't find /etc/fstab in its usual place. You can try setting the environment variable FSTAB_FILE to /mylinux/etc/fstab. This environment variable overrides the standard location for fstab. After setting the variable try running your fsck command again.

Bill
 
Old 06-06-2004, 09:30 AM   #8
gackt3541
LQ Newbie
 
Registered: Jun 2004
Posts: 4

Original Poster
Rep: Reputation: 0
unfortunately,
My root directory is in /dev/hda9.
I can't mount it .
So i need to check & fix the filesystem on /dev/hda9 !
 
Old 06-06-2004, 04:17 PM   #9
wmakowski
Member
 
Registered: Oct 2003
Location: Ohio
Distribution: Fedora 18, 19, RHL 5.2
Posts: 546

Rep: Reputation: 43
Sorry, must have read one too many posts when I replied earlier. I didn't notice that /dev/hda9 was your / partition. Anyway, after rereading I gather that you are able to mount your /boot partition. Don't know if this will work, but how about mounting the /boot partition and creating a temporary fstab file. Then set the FSTAB_FILE variable to make fsck happy? You'll need to set up another mount point perhaps /myroot.

Along with the other entries in fstab you'll need a line something like...
/dev/hda9 /myroot ext3 defaults 1 2

Bill
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Restore GRUB Nilesh.Shah Linux - Hardware 6 01-09-2010 11:43 AM
Grub Restore roopunix Linux - Networking 5 08-29-2005 05:29 PM
Help! Need to restore GRUB after ruining it with XP lamiczka Linux - Software 1 03-22-2005 09:35 AM
Please, restore my faith in GRUB glock27linux Linux - Newbie 8 11-20-2003 01:11 AM
How can I restore GRUB ? xtrips Linux - Software 5 07-30-2003 03:22 PM


All times are GMT -5. The time now is 01:29 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration