LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-31-2009, 12:28 PM   #1
glhere
LQ Newbie
 
Registered: Sep 2006
Posts: 17

Rep: Reputation: 0
primary extensions and dual booting


Each time I try something I find out how much I don't know/how long I can stay new at computer doings...

Tho I have installed/used both operating systems previously, I am currently having problems dual booting win2K and Fedora. Note: I have dual booted before, but always using 2 (or more) Hard Drives. Using the same hard drive for both systems, some questions have come up. The most elemental is one about primary partitions. I have heard that only 4 primary partitions can be made -- but didn't know that was a disk limitation. I had thought this was an operating system limitation :P.

In the end, if I can't have 4 primary partitions per OS (!) I would like to have
in linux
1. primary (2M) partition for the boot drive (/boot)

2. primary partition for /

3. extended partitions for /home, /var

4. extended partition for swap

Under linux I can choose where the extended partitions go. Under windows I can't tell...this is a problem as in win2K I would like:
1. a primary partition for the OS

2. a primary partition that serves for add-on programs, data (which
would include some extended partitions, one for data and another for the ancillary programs I want to add. This is because I have found in the past that if something goes wrong, win2K will re-install its OS without deleting or touching other partitions.

3. somewhere in that win2K installation I would also have an swap partition (logical drive). It won't matter if that extended partition/log drive is in same primary partition of OS or data/programs...

Again, the problem is that I don't know how to tell how separate the logical drive/extended partition is from the primary partition that holds the OS. Perhaps using a liveCD and using fdisk -l will tell me? I know this is not a windows forum, but if anyone has experience with this I wouldn't mind hearing.

Also:
All the postings I have heard talk about putting linux in the free space that windows does not occupy. When I was creating the partitions for win2K I made it small enough that there was plenty of unallocated space on the drive for Linux. Is "unallocated" the same as free space? I ask because when later creating the logical drives under win2K, "Free Space" was created. Do I have to "create" Free Space in order for linux to see the memory? (I wouldn't think so but the linux install crashed when trying to make partitions -- and an fdisk -l using a liveCD among other things indicated that there was /dev/dm-0 with no partition table (and that refers to the unallocated space on the HD)

Last
It might be nice to be able to access data from win2K when using Linux. Does Linux recognize windows logical drives (will have to re-organize if not).


Thanks for any info
 
Old 08-31-2009, 02:25 PM   #2
lurko
Member
 
Registered: Jun 2006
Location: Ontario, Canada
Distribution: Debian
Posts: 448

Rep: Reputation: 35
Whether Windows will recognize a partition or not depends entirely on the filesystem and has nothing to do with whether a partition is primary or not. Basically, if it's FAT or NTFS, Windows can see/read/use it. There's a driver that will let Windows read ext2 (and ext3 also? I'm not sure anymore), but it's best to just use FAT or NTFS IMHO.

Quote:
Perhaps using a liveCD and using fdisk -l will tell me?
I'm not sure exactly what you mean by "how separate the logical drive/extended partition is from the primary partition" but you're idea of using fdisk -l will give you many partition details of a drive, which are primary, which are extended, which are logical drives inside the extended partition, device names currently in use for each partition, and the partition types/IDs. Actually, come to think of it, the partition type may have an affect on Windows seeing the partition, but I'm not positive. I think Windows will recognize an NTFS or FAT filesystem even if it's on a partition with a non-windows partition id (see the last two columns from "fdisk -l"s output). If you're wondering how to see gaps of unallocated space between partitions, fdisk might help, but GParted would be much better for that (see link below).

Maybe I'm wrong, but it seems like you're under the impression that the limit of 4 primary partitions means you can't use more than 4 partitions. The extended partition counts as a primary partition, but logical drives inside it do not - you can have a very large number of those.

Unallocated space is basically unpartitioned free space. Whether you extend/expand the last partition to include the unallocated space, or create a new partition, you can't use that unallocated space until it's part of a partition.

AFAIK, only the Windows system drive needs to be installed on a primary partition. There's no specific need for any apps/data partitions to be primary also. There is no need to put any part of Linux on a primary partition, it'll live happily on a logical drive (edit: or a series of them) inside the extended primary partition.

So here's one way to do it:
1 - 1st primary part. - Windows C:\
2 - 2nd primary part. - Windows D:\ (apps)
3 - 3rd primary part. - Windows E:\ (data)
4 - extended partition (4th primary part.) - filling remaining space, containing all logical drives.
5 - 1st logical drive - linux /boot/
6 - 2nd logical drive - linux /
7 - 3rd logical drive - linux /home/
8 - 4th logical drive - linux /var/
9 - 5th logical drive - linux swap

If your Linux swap sees a lot of use, you might want to put it closer to the front of the drive, though whether you'd notice the difference is debatable. The GParted LiveCD is awesome btw. If you're looking for a LiveCD to partition drives with, that's the one.

Hope that helps, sorry I'm such a long-winded explainer.

Last edited by lurko; 08-31-2009 at 02:31 PM. Reason: /home/ & /var/ on one partition made for a bad example.
 
Old 08-31-2009, 10:00 PM   #3
glhere
LQ Newbie
 
Registered: Sep 2006
Posts: 17

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by lurko View Post
AFAIK, only the Windows system drive needs to be installed on a primary partition. There's no specific need for any apps/data partitions to be primary also. There is no need to put any part of Linux on a primary partition, it'll live happily on a logical drive (edit: or a series of them) inside the extended primary partition.

So here's one way to do it:
1 - 1st primary part. - Windows C:\
2 - 2nd primary part. - Windows D:\ (apps)
3 - 3rd primary part. - Windows E:\ (data)
4 - extended partition (4th primary part.) - filling remaining space, containing all logical drives.
5 - 1st logical drive - linux /boot/
6 - 2nd logical drive - linux /
7 - 3rd logical drive - linux /home/
8 - 4th logical drive - linux /var/
9 - 5th logical drive - linux swap

If your Linux swap sees a lot of use, you might want to put it closer to the front of the drive, though whether you'd notice the difference is debatable. The GParted LiveCD is awesome btw. If you're looking for a LiveCD to partition drives with, that's the one.

Hope that helps, sorry I'm such a long-winded explainer.

Thanks for reply -- not long at all


I actually tried what you suggest on 2 different machines. It doesn't seem to work with 4 win2K partitions, at least on my laptops. (There is an fdisk report below, to show that config, in case you are interested?)

[History: With 4 windows partitions on the first box, fedora 11 would not install at all (even before I got to the partition screen. Anaconda told me to stop and reboot. On the second machine with 4 win2K partitions anaconda allowed me to make a very small linux partition (2M), but nothing else (which seems/seemed strange -- is why I am writing, yes?). Reducing the windows partition numbers to 3 on that (second) machine, anaconda would still make one and only one partition, but that could be of variable size, up to the size of the unallocated space (don't know why the change).]


Note: I will have to check this out, but I believe fedora 11 needs a /boot partition and then logical drives can be created (maybe within yet a second partition??? -- but that is the part I can't get my head around at the moment). I don't know if any of that will be possible with the 3 windows partitions...will have to see...I just know the install so far won't proceed with the 4 partitions.


It seems like a dilemma to me, that with 33G of unallocated space, why will fedora 11 not install...

the fdisk report follows:
[root@localhost ~]# fdisk -l

Disk /dev/sda: 60.0 GB, 60011642880 bytes
255 heads, 63 sectors/track, 7296 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x093e093e

Device Boot Start End Blocks Id System
/dev/sda1 * 1 1275 10241406 7 HPFS/NTFS
/dev/sda2 1276 1912 5116702+ 7 HPFS/NTFS
/dev/sda3 1913 2294 3068415 7 HPFS/NTFS
/dev/sda4 2295 2931 5116702+ 7 HPFS/NTFS

Disk /dev/dm-0: 3221 MB, 3221225472 bytes
255 heads, 63 sectors/track, 391 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

Disk /dev/dm-0 doesn't contain a valid partition table

Disk /dev/dm-1: 3221 MB, 3221225472 bytes
255 heads, 63 sectors/track, 391 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

Disk /dev/dm-1 doesn't contain a valid partition table


Any info is appreciated. Thanks for your time
 
Old 09-01-2009, 03:47 AM   #4
lurko
Member
 
Registered: Jun 2006
Location: Ontario, Canada
Distribution: Debian
Posts: 448

Rep: Reputation: 35
I thought you wanted 4 partitions per OS (5 for Linux actually, if you include the swap)? Your fdisk output shows only 4 partitions, all primary. Where's the extended partition and the logical drives?

Assuming your drive is in the same state as when you ran fdisk (w/ 4 primary partitions):
1. delete the 4th primary partition.
2. create an extended partition in its place, use up all the free space left on the drive. This counts as the 4th primary partition, but you can stick a crapton of logical drives inside it.
3. plan out how much space you want to use for each partition you want to create, so that your last partition uses up the last of the available space.
4. create all the partitions you planned, as logical drives. They'll be created inside the extended partition.
5. assuming you're still using fdisk, print the partition table (with "p") and make sure it looks like you want it to.
6. if all your Linux partitions have the System Id of "7 HPFS/NTFS", use t on each partition and change its id to 83 (for Linux) - except the swap partition, which you should change to 82. You can get a big list of partition types with l (L).

Alternatively, if the first 3 partitions aren't sized to your liking, you could delete them all, create 3 new primary partitions of a size you like, and then start from step 2 above.

I only use fdisk to look at the current partition layout and to change a System Id. It's definitely handy to have, especially in a pinch, but I always prefer to use the GParted livecd to do any actual partitioning. It really is a worthwhile download:
-Great for visualizing a drive's layout
-automatically sets a partition's System Id based on the filesystem you choose to format it with
-resizes partitions very easily.
-even resizes formatted partitions when filesystems are capable (shrink NTFS, expand probably most any filesystem)

A /boot partition may not strictly be necessary. It would depend on if you're planning to use a newer filesystem like btrfs or ext4; if GRUB is not able to read your / partition's filesystem, you would then need a boot partition. A less cutting edge filesystem like ext3 shouldn't require the use of a boot partition. Whether you need one or not depends, I would think entirely, on the filesystem and the bootloader in question.

So, to summarize, strictly speaking you're only required to have 2 primary partitions for what you want to do. One for Windows, and an extended partition containing however many logical drives you want to use. I dislike this setup for aesthetic reasons though, as partition numbers 3 and 4 will never be used, it'll go sda1, sda2, sda5, sda6, etc - but there's no reason you couldn't just set it up like that, Windows would install to the first partition and see any partition with a filesystem it can read, and Linux would (should) install just fine also. Unless you want to install 5 different versions of Windows on the same drive, the limit of 4 primary partitions is basically irrelevant because you can just make one of the 4 an extended partition and put more logical drives in it than you'd ever want or need to use.

PS: did I mention that the GParted LiveCD is awesome?

Last edited by lurko; 09-01-2009 at 03:53 AM. Reason: an of was on
 
Old 09-01-2009, 03:54 AM   #5
eypros
Member
 
Registered: Jun 2005
Location: Salonica
Distribution: Xubuntu
Posts: 40

Rep: Reputation: 15
Hello,

Well seeing your output of fdisk-l command I guess for some reason you are trying to use device mapper virtual mount point (like /dev/dm-x is).
First I don't know a lot about virtual mount point but you surely don't need them to install a linux distro.

You should see some partition like the ones with HPFS/NTFS in your output:
Quote:
Device Boot Start End Blocks Id System
/dev/sda1 * 1 1275 10241406 7 HPFS/NTFS
/dev/sda2 1276 1912 5116702+ 7 HPFS/NTFS
/dev/sda3 1913 2294 3068415 7 HPFS/NTFS
/dev/sda4 2295 2931 5116702+ 7 HPFS/NTFS
Mine for example outputs:
Quote:
Device Boot Start End Blocks Id System
/dev/sda1 1 127 1020096 82 Linux swap / Solaris
/dev/sda2 * 128 5226 40957717+ 7 HPFS/NTFS
/dev/sda3 5227 7011 14338012+ b W95 FAT32
/dev/sda4 7012 12161 41367375 5 Extended
/dev/sda5 9817 10963 9213246 83 Linux
/dev/sda6 10964 12161 9622903+ 83 Linux
/dev/sda7 7012 9816 22531099+ 83 Linux
Why don't you use a live cd like to make partitions and then install? I used to use a Knoppix-clone knoppel with qtparted but what comes handy will be fine. You can also set up your swap there.

P.S. I don't think you need swap in windows -at least not a partition for it-.
 
Old 09-01-2009, 12:10 PM   #6
glhere
LQ Newbie
 
Registered: Sep 2006
Posts: 17

Original Poster
Rep: Reputation: 0
dual boot: unallocated v free space

Quote:
Originally Posted by lurko View Post

2. create an extended partition in its place, use up all the free space left on the drive. This counts as the 4th primary partition, but you can stick a crapton of logical drives inside it.
.
.
.
PS: did I mention that the GParted LiveCD is awesome?


Thanks for your replies/concerns/suggestions

I have not yet done an fdisk on the configuration I have now for win2K,
[2 primary
1 extended with 2 logical drives
33G of unallocated space]

but I am able to get one partition in the unallocated space...

So I have found that indeed the hard drive limits the number of partitions, not the OS...

A pertinent item I don't know for sure about yet is if I accommodate the win2K to my Linux needs/desired configuration (2 partition on win2K) is whether or not anaconda will balk at putting more than one partition in the unallocated space (windows did not like doing that at all), or if I have to configure the unallocated space somehow first (as in windows), (for some reason,) before installing (the 2) fedora partitions. But next go around will tell the tale


cheers

PS I haven't used any partition software since Partition Magic messed up my machine years ago -- but based on your suggestion/sincerity, should I need it, I will certainly download GParted and give it a try!

Thanks again for any info

Last edited by glhere; 09-01-2009 at 08:46 PM. Reason: new info
 
Old 09-01-2009, 07:37 PM   #7
lurko
Member
 
Registered: Jun 2006
Location: Ontario, Canada
Distribution: Debian
Posts: 448

Rep: Reputation: 35
Quote:
Originally Posted by glhere View Post
1. why won't linux install on a HD that gave the (above) fdisk report?
You do mean the fdisk report from post #3 right? The 60GB drive with 4 primary partitions? It's either the fact that every partition has a Windows System Id (I mentioned earlier I'm not positive how much that really matters - it seems like it might do though), or that you were trying(hoping?) to use the unallocated space when you already had 4 primary partitions - without deleting the last primary partition to replace it with an extended, you won't be able to create more partitions than you already have. You could extend the 4th partition to use the unallocated space, but then you'd be short on partitions for what you said you wanted to do.

Quote:
Originally Posted by glhere View Post
2. is unallocated space different from what linux calls free space once windows is already loaded? That is, after installing windows in the first sectors of the hard drive, does one Need to create an extended partition within which linux can install itself?
Unallocated space is not free space as far as any OS is concerned, in any situation. It needs to be partitioned (and formatted) before you can consider it "free space" that you can store files in.

I think you should just create every partition you want to use, then install Windows, then install Linux. There's no rule that says you can't create 1 primary partition, install windows, and then create more partitions in the unallocated space as needed, but I think it's better to plan out how many partitions you need, and their sizes, and then partition the entire drive at the same time.

Quote:
Originally Posted by glhere View Post
I have not yet done an fdisk on the configuration I have now for win2K:
2 primary
1 extended with 2 logical drives
33G of unallocated space

I am hoping linux will install on this -- (the unallocated v free space question is still nagging at me -- is it key?), but will try shortly. (I am not technophobic, just unreasonably hesitant :P)...)
Unallocated space is essentially unusable. You need to partition it. The question is, does the extended partition go to the end of the drive, or does the unallocated space start at the end of the extended partition? I'm assuming it's the latter, and in that case, what you should do is this:
1. delete both logical drives.
2. either a) delete the extended partition and create a new one that fills up ALL the unallocated space.
or b) extend/expand the extended partition so that it fills up ALL the unallocated space.
3. create logical drives as needed.

Actually, I'd delete the logical drives and the extended, create a 3rd primary partition, and then create the extended partition using ALL remaining space and finally create any logical drives, but as I mentioned earlier, I do that purely for aesthetic reasons (so you have partition #s go 1, 2, 3, 4, 5, 6, etc, and not 1, 2, 3, 5, 6, etc).

Partition Magic is OK, but the GParted LiveCD is better. Way more filesystems supported for one thing, and since it's a liveCD, you can do stuff like backups or moving files around too. If you use it incorrectly though, it definitely has the potential to screw up your system. Plan your setup beforehand and use partitioning software with care.

Last edited by lurko; 09-01-2009 at 07:43 PM. Reason: there's always some overlooked typo here or there
 
Old 09-03-2009, 11:50 AM   #8
glhere
LQ Newbie
 
Registered: Sep 2006
Posts: 17

Original Poster
Rep: Reputation: 0
unallocated v free

Quote:
Originally Posted by lurko View Post
Unallocated space is not free space as far as any OS is concerned, in any situation. It needs to be partitioned (and formatted) before you can consider it "free space" that you can store files in.

Unallocated space is essentially unusable. You need to partition it. The question is, does the extended partition go to the end of the drive, or does the unallocated space start at the end of the extended partition? I'm assuming it's the latter, and in that case, what you should do is this:
1. delete both logical drives.
2. either a) delete the extended partition and create a new one that fills up ALL the unallocated space.
or b) extend/expand the extended partition so that it fills up ALL the unallocated space.
3. create logical drives as needed.

Actually, I'd delete the logical drives and the extended, create a 3rd primary partition, and then create the extended partition using ALL remaining space and finally create any logical drives, but as I mentioned earlier, I do that purely for aesthetic reasons (so you have partition #s go 1, 2, 3, 4, 5, 6, etc, and not 1, 2, 3, 5, 6, etc).

What I found was that both Fedora and win2K did recognize unallocated space, that the "Free Space" on windows was actually only for windows, that this "Free Space" is the space in an extended drive that can (still) be partitioned.

As far as the actual partitions, I did is as follows

[win2K]
/dev/sda1 (essentially /)
/dev/sda2 extended
/dev/sda5 (essentially swap, for Adobe products)
/dev/sda6 (essentially /home)
/dev/sda7 (essentially /usr/local)

[Fedora 11 partition]
/dev/sda3 /boot
/dev/sda4 as LVM
VolGroup
LogVol4 /var
lv_root /
lv_swap (swap)
LogVol3 /home
LogVol2 /boot

Now I don't think I would do the Fedora 11 part the same way again. I don't particularly understand it or the nomenclature, but most importantly, since I am not working with multiple disks this time, I would probably opt to do the extended partition, just as in windows...and it will be nice if win2K will recognize a Fedora (linux) Logical Volume cuz if it doesn't I'll be the first to install the next distribution... :P


Thanks for your time -- made me think --

and will try GParted if need arises!


cheers
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Dual head has mind of it's own; how to tell it which is primary monitor? RileyTheWiley Linux - Hardware 2 01-30-2008 01:58 PM
[centos] booting from non-primary drive pcandpc Linux - Distributions 2 04-25-2007 09:35 PM
Problem of dual booting WinXP & Fedora core5 in two primary hard drives biswajit12 Fedora - Installation 5 11-07-2006 10:06 AM
Dual boot primary Linspire & XP primary slave? watmonki Linspire/Freespire 5 11-01-2005 09:16 PM
Booting 4 OS's with three primary partitions.. rrfish72 Linux - General 8 11-14-2004 05:10 PM


All times are GMT -5. The time now is 08:05 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration