LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-13-2006, 05:35 PM   #1
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Rep: Reputation: 45
to many partitions? (IDE: 4 primary, 3 logical)


Hello,

I was monkeying around on my computer at home through ssh trying to set up my system to redo LFS (Linux From Scratch). I had a partition that was not in use, so I decided to break it up into 3 smaller partitions.

Details:
4 Primary partitions
/dev/hda1 was going to be my / LFS partition
/dev/hda2 Temporary / host system (Slackware 10.2)
/dev/hda3 Not being used
/dev/hda4 Swap

So I used cfdisk to break hda3 into 3 smaller partitions (hda5, hda6, hda7), since it would only let me add one more primary partition, I set the new 3 to logical. When I attempted to use ‘mkfs.ext2’ to create the file system, it was complaining about not being able to determine the size of the partition. After a little reading online, I found out that some older versions of fdisk could require a reboot after creation.

After I ran ‘init 6’ and waited a bit to reconnect, my computer was no where to be found. Are there any known problems with having over a cretin number of partitions? Or perhaps with having logical partitions in the middle of my disk?

I just want to know what kind of nasties I can expect when I get back home, and hopefully how to fix it (yes I have a boot disk). Sorry I can’t be more specific but I’m writing this from work since I probably won’t have internet when I get home.

Oh yeah, on other thing, I know the problem is related to the partitions because I had just successfully rebooted right before running cfdisk.


Thanks for your time! Hopefully someone can share their knowledge in the next 2 hours, otherwise I will check back tomorrow.

…drkstr
 
Old 06-13-2006, 05:52 PM   #2
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
First recommendation. Download Knoppix and burn it to a CD before you go home. That way you can boot Knoppix and access the internet from your assumedly non-bootable home system.

Brave one, are you, ... repartitioning and rebooting remotely. May the force be with you!
 
Old 06-13-2006, 06:10 PM   #3
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Original Poster
Rep: Reputation: 45
Quote:
Brave one, are you, ... repartitioning and rebooting remotely. May the force be with you!
If by brave you mean stupid, then you're probably right

Quote:
First recommendation. Download Knoppix and burn it to a CD before you go home. That way you can boot Knoppix and access the internet from your assumedly non-bootable home system.
My life would be much easier if I had a CD burner here at work. Once I get my computer running That's going to be the first thing I do (for future disasters.

Ironically, I usually have a partition with slackware on it for disaster recovery (the one I deleted). I guess this method doesn't work as well as I though it would.

Anyways, I'm not to much at a loss since all my important data is on a separate drive and all I lost was a temporary install anyways. Hopefully I can do this without reinstalling, but not the end of the world if I do.

I would like to know what I did wrong though so i doesn't happen again. Any ideas? I guess it's hard to say until I see what happened when I get home. I'll post back with what I find out.

thanks!
...drkstr
 
Old 06-13-2006, 06:17 PM   #4
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
Post the disk partition table when you get a chance ' /sbin/fdisk -l '. Requires root to run. Lets see what you have now.

Brian1
 
Old 06-13-2006, 06:22 PM   #5
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Original Poster
Rep: Reputation: 45
I actually did that right before I rebooted to see if the cfdisk changes took. It looked a little like this:

/dev/hda1 ext2
/dev/hda2 ext3
/dev/hda4 swap
/dev/hda5 linux
/dev/hda6 linux
/dev/hda7 linux

I don't remember the block locations but I do remember that the last three were located betwen hda2 and hda4. Unfortunatly, once I get a change will probably mean after I have reformated/reinstalled which means I won't have the opertunity to see what went wrong. I will try to avoid the reinstall just for the learning experience.

thanks for the help!
...drkstr
 
Old 06-13-2006, 06:29 PM   #6
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
Quote:
Originally Posted by drkstr
Any ideas? I guess it's hard to say until I see what happened when I get home.
Bingo! No telling until you get a look at it.

My recommendation: Do not quickly turn to a simple reinstall. While this may be the fastest way to recover, you now have a golden opportunity to practice recovery techniques. If you somehow royally hosed your partition table, see what you can do to manually reconstruct it. Play with the "gpart" program if that seems feasible. If you somehow got your partitions "renumbered" in Linux's viewpoint, you may need to create a new initrd. This happened to me. I snuck in a new logical partition "ahead of" some existing ones, so they got renumbered. I knew to change things in /etc/fstab, but it was not immediately obvious to me that I also needed to create a new initrd. Best to practice this now while you're on this non-critical recovery quest.
 
Old 06-13-2006, 06:34 PM   #7
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Original Poster
Rep: Reputation: 45
Quote:
I snuck in a new logical partition "ahead of" some existing ones, so they got renumbered.
Sounds familure ..oh wait, that's exactly what I did

Quote:
Best to practice this now while you're on this non-critical recovery quest.
Very good advice, I plan on making this a learning experience.

I'm going to try and boot from a boot floppy when I get home. I don't know much about initrd, anything I should know before I give it a shot? I'll try and do a little reading before I go home, but it will be hard to search google form a boot floppy.

thanks again!
...drkstr
 
Old 06-13-2006, 06:36 PM   #8
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
p.s. - If your partitions were renumbered, you will also need to edit grub's menu.lst (or the lilo equivalent - I don't use lilo so I don't know what that "equivalent" is).
 
Old 06-13-2006, 06:41 PM   #9
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
Just a thought here:
I see no exteneded partition which is what the logical partitions are held in.
If it is at /dev/hda3 then the /dev/hda4 still a primary partition?
This is where I am not sure but I think if /dev/hda3 is an extened partition the the following ones after that should be logical. I think the primary swap partition in the middle is throwing the drive out of sync. Just a guess. It would be a good think to know.

Brian1
 
Old 06-13-2006, 06:44 PM   #10
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Original Poster
Rep: Reputation: 45
I know how to update lilo and my fstab, but what I don't know off the top of my head is
a) how do I find out what the new partition numbering is (will another (fdisk -l after the reboot show the correct #'s)
b) What do I need to update in initrd (or will this be pretty self explanitary like the fstab?)

Thanks for your quick replies. It's greatly apprecieated!
...drkstr

**edit**
I don't actually even know where the initrd config file is. Will I find it somehwere like /etc/initrd.conf? And once I find it, do I just need to replace the old partition # with the new one, or is there a little bit more to it then that?

thanks!
**edit**

Last edited by drkstr; 06-13-2006 at 06:46 PM.
 
Old 06-13-2006, 06:55 PM   #11
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Original Poster
Rep: Reputation: 45
Quote:
#from initrd man page
OPTIONS

...

root=device-name
Specifies the device to be used as the normal root file system. For LOADLIN this is a command line option. For LILO this is a boot time option or can be used as an option line in the LILO configuration file /etc/lilo.config. The device specified by the this option must be a mountable device having a suitable root file-system.
Am I to understand this correctly that there is no initrd config file? I just need to update my boot loader?

thanks!
...drkstr
 
Old 06-13-2006, 07:01 PM   #12
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
Quote:
Originally Posted by drkstr
I don't know much about initrd, anything I should know before I give it a shot?
Here's a brief synopsis of my problem and solution, from my logbook (I keep written records to help out my aging memory!) This may or may not help you, but then again, it just may! I surely cannot say what I did was the technical correct thing to to, but it worked for me.

Here's the edited (shortened) transcribe from my logbook.

Code:
BEFORE repartition: swap = hda6, / = hda7, /boot = hda8
AFTER: swap = hda7, / = hda8, /boot = hda9

Before I rebooted (too late for you on this step...)
(1) Edited /etc/fstab and fixed partition numbers
(2) Edited /boot/grub/menu.lst and fixed partition references.

You can go back and fix this part by booting Knoppix.

Rebooted.  Error: something about grub not finding it's menu.lst.

From grub> prompt, entered "configfile (hd0,8)/grub/menu.lst"

Then boot continued,but died with kernel panic about not finding an ext3 filesystem on hda7.

Booted Knoppix.
$ su -
# mount /dev/hda8 /mnt/hda8
# mount /dev/hda9 /mnt/hda9
# mv /mnt/hda9/initrd.img-2.6.14-1-686 to BAK.img
# ln -s /mnt/hda8/lib/modules/2.6.14 /lib/modules/2.6.14
# ln -s /mnt/hda8/lib/modules/2.6.14-1-686 /lib/modules/2.6.14-1-686
# mkinitrd -r /dev/hda8 \
           -d /mnt/hda8/etc/mkinitrd \
           -o /mnt/hda9/initrd.img-2.6.14-1-686 \
              2.6.14-1-686
# rm /lib/modules/2.6.14
# rm /lib/modules/2.6.14-1-686
# umount /dev/hda9
# umount /dev/hda8

Rebooted from harddrive, not Knoppix

Got grub> prompt again

Entered "configfile (hd0,8)/grub/menu.lst"

Boot continued!

Complained about LVM last mount time in the future - ignored
(I'll fix it later - due to differing timezones on my system and Knoppix default)

REBOOT WORKED!

From within my harddrive booted system (yea!), recreated initrd
again so I wouldn't have a less than ideal Knoppix copy.

# mkinitrd -o /boot/initrd.img-2.6.14-1-686 2.6.24-1-686

Next,

# grub-install /dev/hda9

Rebooted again.  PERFECT boot!!!
[edit]
Fixed type in transcribed log.

Was: "AFTER: swap = hda7, / = hda8, /boot = hda8"
Now: "AFTER: swap = hda7, / = hda8, /boot = hda9"

I had mistyped the hda9 partition number. there are probably OTHER errors as this was all typed in manually!
[/edit]

Last edited by haertig; 06-13-2006 at 07:09 PM.
 
Old 06-13-2006, 07:08 PM   #13
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Original Poster
Rep: Reputation: 45
OK. thanks for all the help. I'll give it a shot when I get home. Hopefully you hear from me again tonight

Good karma to you sir!
...drkstr
 
Old 06-14-2006, 10:16 AM   #14
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Original Poster
Rep: Reputation: 45
Hmm, well as it turns out, I some how managed to delete the wrong partition (the root host system) and proceeded to break it into smaller logical partitions. Although I'm not sure how I managed to do this because I double checked which partition was the correct one (hda3) before doing it. I also don't understand how I was able to run multiple commands after wiping the drive out.

WHen I got back, I was able to boot to a slackware install CD which kind of works like a knopix in a way (but very limited). Running 'fdisk -l showed' showed that it was /dev/hda2 as an empty "Linux" partition (IE unformatted), and when I mounted /dev/hda3, it was empty.It did not show any of the 3 logical partitions I had created.

I might have just not been going about recovering it right, because I'm still finding it hard to belive I deleted the wrong partition. I remember very clearly that it was /dev/hda3 I didn't need. I guess I might of just hit the wrong thing without realizing it.

Anyways, towards the end of the night, I gave up trying to figure it out and reinstalled. Lucky I have all my important system scripts and .conf files in a slackware package on a separate drive so restoring was not to time consuming.

thanks for the help! maybe I will do better next time.
...drkstr
 
  


Reply



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
Logical drives, and Primary Partitions Infernolinux Linux - Hardware 19 01-09-2006 07:44 PM
Partition Problems: Bad primary partition 1: logical partitions overlap rovitotv Slackware 6 01-08-2006 06:55 PM
primary or logical partitions? blotch Slackware 10 09-09-2004 04:36 AM
Primary vs Logical djgerbavore Linux - Hardware 2 08-16-2004 06:02 PM
Partitioning - Primary and Logical partitions quietguy47 Linux - General 2 07-06-2003 10:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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

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