LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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
 
LinkBack Search this Thread
Old 01-27-2006, 09:42 AM   #1
Luke771
Member
 
Registered: Dec 2005
Location: Sol III, Milky Way
Distribution: Ubuntu
Posts: 43

Rep: Reputation: 15
Dude, where's my partition?


It's like this: I wanted to keep my Ubuntu 5.10 with all my configuration, installed packages, tweaks , colors, and so on, but I still wanted to be able install and run another distro, se how it looks and feels like, check out what does and how good (or bad) it is, and then delete and recreate the whole partition and install yet another distro.
To do that, I resized my hdb6 FAT32 file storage partition with the handy but commercial and non-free Partition Magic, moved the swap partition and resized the extended partition that includes both; that way I got 3 GB of free space right after the hdb1 Linux partition and then I made another primary Ext3 partition as big as the free space, which should be enough to install a distro for testing purposes.
Because I had the same kind of partitioning (two primaries OS partitions on the same drive) before I installed Linux and Windows on two different drives, I figured out that a primary partition that is located right after the primary hdb1, should be called hdb2; so I removed the PMagic CD from the tray and rebooted.
Then I edited /etc/fstab to configure it to mount the new partition at startup; I added the line:
Code:
/dev/hdb2            /hdb2       ext3        defaults             0       0
And of course I made a /hdb2 directory using mkdir (or maybe by right clicking, I don't really remember)
I dont mount my partitions in /media because I don't want to see icon on the desktop, the menus and some panel icons look better and get the job done just as good.

Anyways, the line added in /etc/fstab would do its job when rebootingm so I mounted the new partition maually
Code:
mount -t ext3 /dev/hda2 /hda2
And no: no "sudo" needed; I enabled the root log-in because I was getting sick and tired of having to type in my password every time I wanted to do something more than looking at websites.
When I discovered that I could grant my user super user privileges, which would have the same effect as logging in as root, plus the option of enable automatic log-in, then I had already configured my desktop being logged in as root and I didn't want to reconfigure it all over again as "regular" user, so I still log in as root but some day I will switch back to my original username with super user privileges, so I skip even typing in "root" and "rootpswd", but that's another story, though I've already told it.
Anyhow, when I hit Enter after tyoing in the mount code line, I got the output
Quote:
wrong fs type, bad option, bad superblock on /dev/hdb2,
missing codepage or other error
(aren't you trying to mount an extended partition,
instead of some logical partition inside?)
In some cases useful info is found in syslog - try
dmesg | tail or so
...I'M Ħµ***ñç NOT, YOU MOŦĦ€®Ħ****ER !!!
Are you kidding me or what? (I actually said that to the computer, then I realized why I'm not in therapy: I'm afraid of what might come out)

Let's summarize this again: the first partition on the second hard drive should be hdb2.
No, actually, it *should* not be: IT IS !
Well, the machine says that there's no hda2, which incidentally makes my brand new fstab line quite useless...

Then I tried a different approach: instead of trying to guess what the partition should be called, I decided to let Linux mount *automatically*mount*all*the*available*partitions*
And that's one of the many reasons why everybody should have always at hand at least one Linux liveCD (I have four of those)
I booted from a Slax liveCD, logged in and checked it out.
My partition was being mysteriously named /dev/hdb3.

OK, that solved the mystery of the disappearing partition; I changed the line in /etc/fstab to make it point to /dev/hdb3 and mount to/hdb3 and everithing is up and running, but the big question is:
*Why* is that partition being called "hdb3" when it is obvious that it should be called "hdb2"?
"It's because you resized and made a partition between two existing ones" is not an answer: it doesnt explain why have a "3" following a "1", instead of the more appropriate "2".

That's the question:
Why is it called hdb3, and not hdb2?
(and when making one primary, one swap and one logical, as on my hda, why do I get hda1 as the primary and then hda6 as logical? Where are hda2 and hda3?
Counting the swapspace and the extended partition we have: hda1 primary, hda4 extended, hda5 swap logical and hda6 logical. No hda2 and hda3.

The good part is that when I made the new partition it tok an empty place in the line and didn't need to change the numbers of the partition coming after, which is good and probably planned, but I still woulld like to have my partition numerically ordered and with no "jumps": hda1 hda2 hda3 and so on
And by the way, I've never understood what that BTW acronym stands for.
(the last line is said to have been seriously posted on a forum)
 
Old 01-27-2006, 11:33 AM   #2
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,264

Rep: Reputation: 128Reputation: 128
Open a console and run:

$ sudo fdisk -l

and post the output here. If you made a root account, you can just su to root and run the above. This will print out all partitions recognized by your system, whether mounted or not and should give the info needed to answer your questions.

Re hda. The first logical drive is always hda5; hda1 through 4 are reserved for the primary partitions. So even if your extended partition was on hda2, as I suspect it is, the first logical drive will be hda5, even though there is no hda3 or hda4. The fdisk output will show this very clearly.
 
Old 01-27-2006, 02:59 PM   #3
Luke771
Member
 
Registered: Dec 2005
Location: Sol III, Milky Way
Distribution: Ubuntu
Posts: 43

Original Poster
Rep: Reputation: 15
OK, I'm going to do that and post the output in a little while, in the meantime; if the first logical is always hd(x)5 than you cant have more than 3 primary partition, therefore the firest logical is probably *at least* hdx5, or there is actually an upper limit at three primaries?
Well, I could just get the answer by experimenting, and maybe I will.
OK, I'll be back in a while for the fdisk output
oh,and by the way, I am *always* logged in as root because I hate to get "permission denied" messages, it reminds me of my failures with women :-)

Last edited by Luke771; 01-27-2006 at 03:15 PM.
 
Old 01-27-2006, 03:39 PM   #4
Luke771
Member
 
Registered: Dec 2005
Location: Sol III, Milky Way
Distribution: Ubuntu
Posts: 43

Original Poster
Rep: Reputation: 15
OK, I got it.
A simple look at the fdisk-l output made all clear, thanks for the hint.
Before I made the new Linux Ext3 partition, hdb was divided into one primary Ext3 and one extended partition with the swap and a fat32 file storage partition, which made the extended partition hdb2, the swap space hdb5 because it's always 5 as you said before, and the file storage partition became hdb6.
I *resized* the existing partition, not deleted them, to make space for the new one, therefore the extended partition hdb2 *stayed*hdb2*; the first logical is still always 5,which makes the new partition hdb3, of course (and I feel like the biggest moron in the northern emisphere for not figuring that out by myself)
Here comes the fdisk -l output, look at hdb
Quote:
root@ubuntu:~# fdisk -l

Disk /dev/hda: 41.1 GB, 41110142976 bytes
255 heads, 63 sectors/track, 4998 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 765 6144831 7 HPFS/NTFS
/dev/hda2 766 4998 34001572+ f W95 Ext'd (LBA)
/dev/hda5 766 1409 5172898+ 7 HPFS/NTFS
/dev/hda6 1410 3583 17462623+ b W95 FAT32
/dev/hda7 3584 4998 11365956 7 HPFS/NTFS

Disk /dev/hdb: 41.1 GB, 41110142976 bytes
255 heads, 63 sectors/track, 4998 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 * 1 1275 10241406 83 Linux
/dev/hdb2 1677 4998 26683965 f W95 Ext'd (LBA)
/dev/hdb3 1276 1676 3221032+ 83 Linux
/dev/hdb5 1677 1938 2104483+ 82 Linux swap / Solaris
/dev/hdb6 1939 4998 24579418+ b W95 FAT32

Partition table entries are not in disk order
(I guess next time I should think a little more before I post)

Last edited by Luke771; 01-27-2006 at 03:41 PM.
 
Old 01-27-2006, 04:51 PM   #5
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,264

Rep: Reputation: 128Reputation: 128
You are limited to 4 primary partitions. Logical drives were devised to get around this limitation. To make a logical drive, you need to make an extended partition which takes up one of your primary partitions. However, one extended partition can hold a virtually unlimited number of logical drives. It's not really unlimited, but it's so many, you would never run out of logical drives if you want to keep creating them. The extended partition acts like a place holder for all your logical drives on the hard drive.
It's a little confusing but the fdisk output usually makes things pretty clear for people.
 
Old 01-28-2006, 05:24 AM   #6
Luke771
Member
 
Registered: Dec 2005
Location: Sol III, Milky Way
Distribution: Ubuntu
Posts: 43

Original Poster
Rep: Reputation: 15
Yes, the extended partition is primary, I know that, but I never realized that logical partitions were invented to overcome some limitations, so now I know that the first logical drive is *always* hdx5, and ot *at least* 5 as I tought.
As they say "You never stop learning" is actually true.
thank you.
 
  


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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dude, Where's My Touchscreen? longtex Linux - Hardware 5 12-28-2005 12:34 PM
dude, where's my internet? daynah Linux - Networking 3 11-30-2005 09:15 PM
Rock On Dude lastkidpicked LinuxQuestions.org Member Intro 2 09-26-2003 09:32 PM
New dude and need info Evil Penguin Linux - Newbie 5 05-25-2003 06:28 AM
Dude- where's my SCSI? :) Kit Linux - Hardware 25 03-05-2003 08:34 AM


All times are GMT -5. The time now is 07:20 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
Open Source Consulting | Domain Registration