Jump to content
Compatible Support Forums
Sign in to follow this  
Furrry

I wounded my system with fdisk...

Recommended Posts

I decided to try and increase the size of one of my partitions, and deleted a couple that I don't use that were next to it in preparation to expanding it somehow. hdb6 was full, and hdb7 and hdb8 were empty, so I killed the latter two with fdisk. Unfortunately I didn't think far enough ahead, and now the ( rather important ) hdb9 is hdb7 and my system just keeps blinking at me in dumb amazement that I could be so short-sighted.

 

I actually boot off of hdc, using GRUB, but it doesn't get anywhere close to opening the desktop...although it appears to be trying very hard.

 

Is there a simple way for me to restore the old partition table, or ( preferably ) explain the new layout to hdc? I have floppy boot disc, but don't really know how to use it wisely, and I understand that the RedHat9 install CD1 has a repair function...?

 

Thanks....( and by the way, when I get this mess fixed, how do I increase the size of a partition which is next to free space on the drive..?)

 

Allen

Share this post


Link to post

You'll have to boot up in single-user mode. If your boot partition is still intact, this will bring you to a command line. From there, you should be able to update your /etc/fstab - that's where the problem is.

 

In grub, edit the boot line, adding the word "single" at the end. Hit esc, then "b" to boot up. The boot process will give you just the minimal set of drivers and utilities (vi included) to edit the fstab and set things straight.

Share this post


Link to post

Thanks...I managed to boot using the RH9 disc1, in rescue mode, and got to a shell. Edited /etc/fstab to switch back to hdb11 from hdb9 ( where I had edited it to before the re-boot that has caused these problems) for a rather inconsequential mount ( storage space, really, no programs or anything), but it came up in the same way...stalls out trying to open the desktop, and then switches back to the screen where it is waiting for a login, but doesn't give me enough time to do it before it vanishes again for awhile. What do I need to edit in /etc/fstab...?Everything looks fine except for that?

 

My fear is that there was some space reserved on one of the partitions that I deleted (so I re-installed two replacements to sneak hdb9 back up to hdb11), for example /dev/shm ( whatever that is...?) and my system hangs without it.

Share this post


Link to post

Sounds like your root (/) partition designation may be off too in fstab?

 

Is it the root partition that got changed in the process?

 

First stop changing the partitions and determine what your Redhat partitions are.

 

Originally, during the RedHat install, did you set up just one partition for everything, or do you have multiple partitions for RedHat?

 

Post what the partitions are, so we can take a look at them.

 

Make sure fstab points to the correct partitons for each.

 

Boot normally and see what happens.

 

If you added single to the grub menu of config file, remove it, so that the system will try to login to the GUI.

Share this post


Link to post

Edit your inittab so you boot to a command prompt. That'll make things easier. Later, you'll be able to your desktop by typing startx, or just change inittab back to a graphical logon.

 

I think maybe you hosed up your swap space. See where it was mouted in fstab, and just comment it out for now.

Share this post


Link to post

Yeah, I think you are right. I had installed two different Linuxes, and that left me with two swap spaces, which GRUB recognized upon install of hdc. One of the partitions I recreated was originally a swap partition, but I didn't indicate it as such when I recreated it. I re-installed RH9 on hdc ( which is my safety drive for such occasions...I'm a newbie and I do stuff like this now and then ), using GRUB, so I can get back into Windoze on hda, now, and I told grub about hdb6, which is my main RH9 system, but it gives me an error message and won't boot...something about the root sector invalid ( that is NOT an exact quote). I can get in to hdb6, now though, through hdc to edit files. I just downloaded GRUB, thinking that the version that I have is old, but I don't really think that's the problem. I should recreate the swap space do you think?

 

Couple of questtions more..._is there a way to increase a partition size? Also, what is /dev/shm space used for? If you can point me to a good resource for questions like this great! Thanks again. I'll post the resolution should it happen....

Share this post


Link to post

The error message I now get from grub is bad file system or directory...here are my two fstabs...the first one is the fstab for hdb6 ( which I mounted for access to it from hdc ), and the second is the fstab for hdc. Does this tell you anything?

 

[root@x1 root]# cat /mnt/hdb6/etc/fstab

LABEL=/ / ext3 defaults 1 1

LABEL=/boot /boot ext3 defaults 1 2

none /dev/pts devpts gid=5,mode=620 0 0

none /proc proc defaults 0 0

none /dev/shm tmpfs defaults 0 0

/dev/hda5 swap swap defaults 0 0

/dev/fd0 /mnt/floppy auto noauto,owner,kudzu 0 0

/dev/hda1 /mnt/cwindows vfat auto,umask=0 0 0

/dev/hdb1 /mnt/dwindows vfat auto,umask=0 0 0

/dev/hdb5 /mnt/ewindows vfat auto,umask=0 0 0

/dev/cdrom /mnt/cdrom udf,iso9660 noauto,owner,kudzu,ro 0 0

 

[root@x1 root]# cat /etc/fstab

LABEL=/1 / ext3 defaults 1 1

LABEL=/boot1 /boot ext3 defaults 1 2

none /dev/pts devpts gid=5,mode=620 0 0

none /proc proc defaults 0 0

none /dev/shm tmpfs defaults 0 0

/dev/hda5 swap swap defaults 0 0

/dev/hdb10 swap swap defaults 0 0

/dev/hdb8 swap swap defaults 0 0

/dev/hdc2 swap swap defaults 0 0

/dev/cdrom /mnt/cdrom udf,iso9660 noauto,owner,kudzu,ro 0 0

/dev/fd0 /mnt/floppy auto noauto,owner,kudzu 0 0

 

I'm at a loss where to go from here! "fsck -a" wouldn't work in this instance, would it?

Share this post


Link to post

To create a swap disk, run mkswap:

mkswap [ -c ] device [size-in-blocks]

 

See the man page for more detail.

 

You should be able to run without a swap space anyway. Some folks prefer it that way, especially if you have enough ram. For now, just comment the lines out where swap areas are defined.

 

I don't know how you can restore the old partition table, but that shouldn't be necessary.

 

For what it's worth, I think you're pretty close to solving your woes. As long as you can still boot at all, there's hope.

 

Try this: from a command prompt, run fdisk /dev/hdX, where X is the drive. Type p to print out the partition table. Then see how that matches up with your fstab. That should help you sort things out.

 

Since you have 2 linux installations, be careful to keep things straight.

 

Don't worry about /dev/shm. It's a virtual drive, but don't try using it as a regular partition.

Share this post


Link to post

OK, I'm as little confused, but I think that I got it.

 

Don't create anymore filesystems or swap space.

 

Where exactly is root for RedHat now - This is the installation we are talking about, right?

 

Both entries for grub and fstab need to point to the proper root directory for the kernel to boot. This is probably why you are getting the grub error message, it can't find vmlinuz...or what the kernel file is.

 

You have swap space from another installation, so this can be used. Just make sure that one of the partitions for swap space is in fstab.

 

If you can determine where root is, then you need to modify the grub.conf or menu.list to reflect where the root is now, so the kernel is found correctly, when grub attempts to boot.

 

Since you changed partitons, we need to make sure that we have the correct one. Sounds like you are getting good at this, so let's go one step at a time.

 

This is the issue, since you have multiple partitions and linux installations, you need to point to where root for RedHat is currently.

 

And, yes, you can extend the partition later on, with either PartitionMagic or a linux utility, such as qtparted.

 

I prefer these, as they give you a graphical representation of what the disks and partitions look like.

 

But please, don't do this now.

Share this post


Link to post

Once you get everything straightened out, and you boot graphically, you can use qtparted to resize your partitions. Its a great little program and super easy to use.

Regards,

Steve

Share this post


Link to post

Furry, if you have 512 or better RAM, you may not even miss your swap. I often run mine after commenting out the swap to squeeze a little extra performance out while gaming! smile

Share this post


Link to post

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×