LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 05-07-2012, 05:57 AM   #1
vectrum
Member
 
Registered: Jul 2011
Posts: 59

Rep: Reputation: Disabled
How to create 5 primary partitinos (more than 4 as a matter of fact )


How to create more than four primary partitions in order to create the following file systems in their own respective partitions; /, /boot, /usr, /var, /tmp, /tmp and /opt and /home.

Does LVM allow it? Or is it only possible in non-pc
system?

Thanks..
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 05-07-2012, 06:00 AM   #2
wildwizard
Member
 
Registered: Apr 2009
Location: Oz
Distribution: slackware64-14.0
Posts: 755

Rep: Reputation: 226Reputation: 226Reputation: 226
Can't be done

This is why the extended partition and logical partitions exist.
 
1 members found this post helpful.
Old 05-07-2012, 06:10 AM   #3
vectrum
Member
 
Registered: Jul 2011
Posts: 59

Original Poster
Rep: Reputation: Disabled
Thanks.

I know that but want to know how did they install unix in
the system where every file system had got its own partition.
 
Old 05-07-2012, 06:12 AM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,201

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
Quote:
Originally Posted by wildwizard View Post
Can't be done
Wanna bet ?. That is just a convention. Other scenarios are possible, but require other tools than normally used. Look up gpt for instance.
Quote:
This is why the extended partition and logical partitions exist.
This is indeed true for what have been come to be known as "MBR partitions". Just about everyone has historically used this structure.
 
1 members found this post helpful.
Old 05-07-2012, 06:16 AM   #5
wildwizard
Member
 
Registered: Apr 2009
Location: Oz
Distribution: slackware64-14.0
Posts: 755

Rep: Reputation: 226Reputation: 226Reputation: 226
Quote:
Originally Posted by vectrum View Post
Thanks.

I know that but want to know how did they install unix in
the system where every file system had got its own partition.
http://uw714doc.sco.com/en/man/html.7/vtoc.7.html

Now did you really want the answer?
 
1 members found this post helpful.
Old 05-07-2012, 06:24 AM   #6
the_gripmaster
Member
 
Registered: Jul 2004
Location: VIC, Australia
Distribution: RHEL, CentOS, Ubuntu Server, Ubuntu
Posts: 356

Rep: Reputation: 38
Quote:
Originally Posted by vectrum View Post
How to create more than four primary partitions in order to create the following file systems in their own respective partitions; /, /boot, /usr, /var, /tmp, /tmp and /opt and /home.

Does LVM allow it? Or is it only possible in non-pc
system?

Thanks..
It is definitely possible to create more than 4 primary partitions. Just use GPT instead of msdos partition table. However, what you are trying to do can be done with just 2 primary partitions.

1st primary partition of ext3/4: /boot
(512MB should be good enough for /boot)
2nd primary partition of LVM: this will hold the other partitions separately

First create 2 primary partitions using fdisk or parted. Then

Code:
mkfs.ext4 /dev/sda1
For the LVM:

Code:
pvcreate /dev/sda2
vgcreate vgmain  /dev/sda2
lvcreate -L 4G -n lvroot vgmain && mkfs.ext4 /dev/vgmain/lvroot
lvcreate -L 10G -n lvusr vgmain && mkfs.ext4 /dev/vgmain/lvusr
lvcreate -L 8G -n lvvar vgmain && mkfs.ext4 /dev/vgmain/lvvar
lvcreate -L 4G -n lvtmp vgmain && mkfs.ext4 /dev/vgmain/lvtmp
lvcreate -L 4G -n lvopt vgmain && mkfs.ext4 /dev/vgmain/lvopt
lvcreate -L 10G -n lvhome vgmain && mkfs.ext4 /dev/vgmain/lvhome
The /boot is better placed outside the LVM. After creating the partitions you need to make the appropriate entries in the /etc/fstab of course.

Last edited by the_gripmaster; 05-08-2012 at 07:04 AM. Reason: partition size missing, fixed it
 
1 members found this post helpful.
Old 05-07-2012, 06:36 AM   #7
Ilgar
Member
 
Registered: Jan 2005
Location: Istanbul, Turkey
Distribution: Slackware 14.1, Slackware64 14.1
Posts: 921

Rep: Reputation: 92
LVM is possible, but "logical partitions" can also be used for what vectrum wants. You don't need a partition to be a primary one to use a different filesystem on it.
 
2 members found this post helpful.
Old 05-07-2012, 07:39 AM   #8
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,033

Rep: Reputation: 753Reputation: 753Reputation: 753Reputation: 753Reputation: 753Reputation: 753Reputation: 753
You can fiddle around and make more than four primaries but... why? Three primaries and some number of logical partitions accomplishes what you want to do without the need to fiddle and twiddle when you get around to updating or reinstalling or whatever may come up. Maybe the only thing you have to worry about is how much the drive heads are flying around to read or write although that's more or less moot nowadays.

I use nine partitions: /root, /swap, /home /usr/local, /opt, /var/lib/mysql, /var/lib/virtual, /spares and /var/lib/psql. I do it so that I do not have to back off large-scale data bases (in /var/lib/mysql and /var/lib/psql), virtual machines (in /var/lib/virtual -- do not want to have to reinstall Windows!), additional applications (/opt), additional utilities, all my user's stuff (/home) and other software (/usr/local) when I upgrade to a new release of Slackware (all you do is not format the partitions you want to "save" when assigning the partition names to fstab during installation -- gives me a "clean" install rather than going through all the trouble of upgrading). I've never needed a /boot partition for anything I know of (it's in /root, why fiddle?), I don't do /usr because that's were all the system libraries live and, well, that works for me.

You can, of course, add additional drives (just make sure they get mounted at the right time so the the thing'll boot, eh?). I have kept the data bases on separate drives but anymore I just let 'em live in their own logical partitions and life (so far) is good. Everything works if you let it.

Hope this helps some.
 
1 members found this post helpful.
Old 05-07-2012, 02:35 PM   #9
vectrum
Member
 
Registered: Jul 2011
Posts: 59

Original Poster
Rep: Reputation: Disabled
Thank you very much for the suggestions. One thing I should have mentioned that when I referred to a primary
partition, I actually wanted to mean physical partition
because if I was able to set up aforementioned file systems in separate physical partitions then, in case of any particular file system damage, other file systems wouldn't be affected as this is not the case in logical partitions where a corrupt logical partition will destroy other logical partitions.

wildwizard told me 'Now did you really want the answer?'
Yes, Your link has reminded me of setting up solaris and freebsd sys(many slices inside a partition). Thanks for providing the empirical knowledge.

LVM solution is really nice. Master's solution without any gripe. Thanks.

tronayne: Here is my scenario. Why I have had to fiddle with boot partition. I have got two hdds, sda and sdb. I installed win, solaris and linux 100mb boot partitions in three primary partitions in sda(sda1, sda2, and sd3) and installed freebsd, slack and linux swap in three primary partitions, sdb1, sdb2 and sdb3. My boot manager is lilo (I could have used soalaris' grub)and it couldn't boot if I place boot in sdb so I have had to keep /boot in sda.

I don't know whether that was possible to make solaris, freebsd boot from logical partitions. My entire partition scheme was faulty I suppose but I can't make it from scratch due to the admin level hitch.

You have created nine partitions!
How did you do it?
Are all these primary partitions?
Are all in a single hdd?
Thanks again.
 
Old 05-07-2012, 02:52 PM   #10
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,509
Blog Entries: 2

Rep: Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018
Quote:
Originally Posted by vectrum View Post
Thank you very much for the suggestions. One thing I should have mentioned that when I referred to a primary
partition, I actually wanted to mean physical partition
because if I was able to set up aforementioned file systems in separate physical partitions then, in case of any particular file system damage, other file systems wouldn't be affected as this is not the case in logical partitions where a corrupt logical partition will destroy other logical partitions.
Where did you get that from? Logical partitions are physical partitions, they are just organized differently.

To clarify that: Due to limitations of the old MS-DOS style partition table you can not create more than 4 primary partitions when using this style (when using GPT instead you can create many more). One of these primary partitions can be an extended partition. Extended partitions are nothing more than a way to overcome the partition tables limitation with creating a container for more physical partitions, called logical partitions. There are only two things that are different for a logical partition compared to a primary partition:
1. They have to be in an extended partition.
2. There data (read: start-sector, end-sector, ID, ..) is not stored in the partition table in the MBR.

Nonetheless, they are physical partition, a corrupted logical partition has the same chance of corrupting other partitions as a primary partition.
 
1 members found this post helpful.
Old 05-07-2012, 03:32 PM   #11
vectrum
Member
 
Registered: Jul 2011
Posts: 59

Original Poster
Rep: Reputation: Disabled
Thank you. I need a time out as I discard the concept about logical partition. It might be possible that I came to know from a dos community when I learnt to install dos. I hadn't got any chance to install *nix.

Can I boot linux from a logical partition?
 
Old 05-07-2012, 03:35 PM   #12
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,509
Blog Entries: 2

Rep: Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018
Without any problem.
 
1 members found this post helpful.
Old 05-08-2012, 07:04 AM   #13
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,033

Rep: Reputation: 753Reputation: 753Reputation: 753Reputation: 753Reputation: 753Reputation: 753Reputation: 753
Quote:
You have created nine partitions!
How did you do it?
With cfdisk, see below.
Quote:
Are all these primary partitions?
No. See below.
Quote:
Are all in a single hdd?
Yes.

Well, I don't have multiple Linux distributions, just Slackware (hmm. "just?" Well, go with the best, methinks). I do have two virtual machines, XP and Win7, and those are in the partition mounted to /var/lib/virtual. Right now, in this box, there is only one drive -- the other box has two (both 500G).

There are only three primary partitions -- as explained above by TobiSGD, you can only have four primaries (and no logical) or three primaries plus X number of logical.

I use the cfdisk utility to set up disk drives (it uses ncurses to display all the drive information and permit easy editing). cfdisk is on the Slackware installation CD-ROM/DVD and you use it to partition your drive before you execute setup to install Slackware.

The display looks like this:
Code:
                            cfdisk (util-linux 2.19)

                              Disk Drive: /dev/sda
                       Size: 500107862016 bytes, 500.1 GB
             Heads: 255   Sectors per Track: 63   Cylinders: 60801

    Name        Flags      Part Type  FS Type          [Label]        Size (MB)
 ------------------------------------------------------------------------------
    sda1                    Primary   ext4                             15998.17 
    sda2                    Primary   swap                             15998.17
    sda3                    Primary   ext4                             20003.89
    sda5                    Logical   ext4                             20003.89
    sda6                    Logical   ext4                             20003.89
    sda7                    Logical   ext4                             20003.89
    sda8                    Logical   ext4                            100002.96
    sda9                    Logical   ext4                            100002.96
    sda10                   Logical   ext4                            188087.48




     [ Bootable ]  [  Delete  ]  [   Help   ]  [ Maximize ]  [  Print   ]
     [   Quit   ]  [   Type   ]  [  Units   ]  [  Write   ]

                  Quit program without writing partition table
Of course you can, logged in as root or su - or sudo, look at your drive(s) with cfdisk on a running system -- you don't want to fiddle around and try to edit a drive on a running system (except a new one you're formatting and partitioning), but you can look at any drive with
Code:
su -
cfdisk /dev/sda
cfsisk (and fdisk) are standard utilities installed in /usr/sbin; they're not to be used by any but root. When you've partitioned a drive using either of them, you need to add entries in /etc/fstab for it (which is done during Slackware installation because you partition fist, then run setup and you're asked for the partition information).

The primary-logical thing is a hangover from olden days and Miserydos, partition tables and MBRs and who knows what all. Keep in mind that your partitions, whether they're called primary or logical start and end at specific addresses on the drive and have a specific size. You don't really care what the addresses are (that's taken care of by the controller and system software) and utilities such as df and du will tell you how much storage space you've got available and how much you've used. And when you run out of space in a given partition, well, then you'll find out that it really is physical space and holy toot, what do I do now.

Hope this helps some.
 
2 members found this post helpful.
Old 05-08-2012, 09:04 AM   #14
saulgoode
Member
 
Registered: May 2007
Distribution: Slackware
Posts: 226

Rep: Reputation: 90
If you use either EFI or UEFI instead of BIOS then you are not limited to just four primary partitions. The upper limit is not a fixed number, but is typically more than 128 partitions.
 
1 members found this post helpful.
Old 05-08-2012, 10:51 AM   #15
dfwrider
Member
 
Registered: Feb 2010
Location: San Antonio, Texas, USA
Distribution: slackware
Posts: 32

Rep: Reputation: 17
There are reasons to have separated file system areas. Some of those reasons go away, when we're talking about a system without multiple physical drives, and without NFS mounts.
 
1 members found this post helpful.
  


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
Possible to create Swap part. after the fact? jabulani_jonny Linux - Newbie 2 05-02-2006 11:17 AM
my current primary partion is ext3 with linux installed in it . i want to create a pr amolgupta Linux - Software 1 07-28-2005 08:16 PM
cfdisk - create primary dos part. digitalhead Linux - General 3 03-17-2005 10:41 PM
Should I create a 1GB PRIMARY Partition for /boot bluedevlx Linux - Newbie 10 11-20-2004 05:36 PM
/home - primary or logical - matter? reggie Linux - General 7 01-01-2003 11:46 PM


All times are GMT -5. The time now is 01:55 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