Re: Maximum partitions on a SATA disk
- From: Aragorn <aragorn@xxxxxxxxxxxxxxxxxxx>
- Date: Mon, 16 Aug 2010 23:24:24 +0200
On Monday 16 August 2010 21:02 in comp.os.linux.hardware, somebody
identifying as brownh wrote...
I've long run SCSI and for some odd reason partition my drives for the
maximum number of partitions. However, I'm trying to install on a SATA
drive, and wonder if my problem getting the boot loader to access the
root directory (debian squeeze, GRUB2) might be related to having too
many partitions.
Well, let's get this out of the way first: SATA disks have the same
limitations in terms of the number of usable partitions. This is not a
property of the disks themselves but of the operating system.
SATA disks (and since recently also PATA disks) are handled by the same
generic SCSI code in the Linux kernel, and although you can create more
partitions on the same disk, the kernel will only be able to see 15 of
them.
On the disk I have 15 partitions, not including the logical container
sda5.
"/dev/sda5" can never be the extended partition container, because that
device special file is reserved for the first logical partition in the
extended container, and the highest partition number the extended
container can have for itself is "4" - i.e. "/dev/sda4". Partition
numbers 1 to 4 are reserved for primary partitions - i.e. partitions
which have their entry in the partition table in the MBR, and the
extended partition container must be one of those - and logical
partitions in extended containers start at 5.
I suppose this counts and to there are 16 partitions altogether,
and I assume this is the maximum. Is this the maximum on a SATA disk?
Yes, and since recently, on all hard disks. The Linux kernel is now
using libata for PATA disks as well, and libata makes use of the SCSI
midlayer in the kernel.
There *is* however a workaround, i.e. you can use logical volume
management. You can create multiple logical volumes inside a
single "physical" partition, because LVM is an abstraction layer above
the partitioning layer.
Is there anything wrong with my habit of operating with so many
partitions?
Not really. In fact, I find it good practice to separate dynamic and
static filesystems.
The reason for the large number is that I've always followed
recommendations in the past to break out one partition or the other
(such as /usr/local), and I need five custom partitions. Besides
these, I have as partitions: /, boot, home, usr, var, tmp, opt,
swap.
"/tmp" can eventually be located on a tmpfs. Saves you one disk
partition and in addition it's faster and it'll be empty after a
reboot.
It is my impression that the location of partitions is today no longer
particularly important on a desktop machine. If I were to reduce this
list of partitions by one, should it be to put /usr under /? With 8 Gb
RAM and no CPU intensive applications, could I eliminate swap?
My recommendations:
(1) Use a tmpfs for "/tmp"; and
(2) Use LVM2 logical volumes for variable filesystems.
The former will save you a partition, and the latter circumvents the
limitations to the amount of usable partitions of the SCSI midlayer.
--
*Aragorn*
(registered GNU/Linux user #223157)
.
- Follow-Ups:
- Re: Maximum partitions on a SATA disk
- From: Pascal Hambourg
- Re: Maximum partitions on a SATA disk
- References:
- Maximum partitions on a SATA disk
- From: brownh
- Maximum partitions on a SATA disk
- Prev by Date: Maximum partitions on a SATA disk
- Next by Date: Re: Maximum partitions on a SATA disk
- Previous by thread: Maximum partitions on a SATA disk
- Next by thread: Re: Maximum partitions on a SATA disk
- Index(es):
Relevant Pages
|