primary partitions - Hardware

This is a discussion on primary partitions - Hardware ; Which filesystems need to be primary partitions? I'm getting a new laptop, and will leave some for the Vista, another partition for /, another for /boot, another for swap, and another for /home (or somesuch .. the rest of the ...

+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 20 of 22

Thread: primary partitions

  1. primary partitions


    Which filesystems need to be primary partitions? I'm getting a new
    laptop, and will leave some for the Vista, another partition for /,
    another for /boot, another for swap, and another for /home (or somesuch ..
    the rest of the user data), and another set aside for experimenting with
    other distros.

    My understanding is that you can have at most 4 primary partitions.
    I'll waste one on Vista, one on... i think root for my primary
    Linux installation. Does swap or /boot have to be on a primary
    partition?

    It's just not going to add up if i need one for root, boot, swap,
    Winbloze, and maybe another to for distro playing.

    TIA!

  2. Re: primary partitions

    Time Waster wrote:

    >
    > Which filesystems need to be primary partitions? I'm getting a new
    > laptop, and will leave some for the Vista, another partition for /,
    > another for /boot, another for swap, and another for /home (or somesuch ..
    > the rest of the user data), and another set aside for experimenting with
    > other distros.
    >
    > My understanding is that you can have at most 4 primary partitions.
    > I'll waste one on Vista, one on... i think root for my primary
    > Linux installation. Does swap or /boot have to be on a primary
    > partition?
    >
    > It's just not going to add up if i need one for root, boot, swap,
    > Winbloze, and maybe another to for distro playing.
    >
    > TIA!


    Swap can be on a logical partition... no problems. In fact, swap can be a
    file too...

    Boot? Unless someone else can chime in, /boot must be a primary partition.

    Root? I'm not too sure about this one. I've always made them primary's...


    --

    Jerry McBride (jmcbride@mail-on.us)

  3. Re: primary partitions

    On Sun, 01 Jun 2008 22:26:14 -0400, Jerry McBride wrote:

    > Boot? Unless someone else can chime in, /boot must be a primary partition.
    >
    > Root? I'm not too sure about this one. I've always made them primary's...


    I have done lots of installs in the extended partition.

    Everything was installed in the partition. I used lilo and grub in the
    mbr for booting all of them.

    here is a snippet from blkid /dev/hd*
    /dev/hda6: LABEL="free_6a"
    /dev/hdb1: UUID="5509e053-4612-4c52-84b0-fb94252c1e3a" TYPE="swap"
    /dev/hdb10: LABEL="ubuntu"
    /dev/hdb11: LABEL="2007_1"
    /dev/hdb12: LABEL="2008_0"
    /dev/hdb13: LABEL="suse"
    /dev/hdb14: LABEL="2007_0"
    /dev/hdb15: LABEL="pclinux"
    /dev/hdb5: LABEL="2006_0"
    /dev/hdb9: LABEL="kubuntu"
    /dev/hdb10: LABEL="fedora"

  4. Re: primary partitions

    Time Waster wrote:

    > Which filesystems need to be primary partitions?


    That depends on the operating system you intend to install on your computer.
    MS-DOS requires a primary partition of which the first sector starts within
    the first 32 MB of the diskspace. The same thing applies to Windows,
    although Windows itself can be installed inside any other partition, as
    long as such a primary partition exists, because that is where Windows
    stores its bootloader.

    GNU/Linux doesn't care about whether partitions are primary or logical
    partitions in an extended partition container, and or whether the partition
    is marked bootable in the partition table - at least, not if you have the
    bootloader reside in the MBR of the first hard disk approached as bootable
    by the BIOS.

    > I'm getting a new laptop, and will leave some for the Vista, another
    > partition for /, another for /boot, another for swap, and another
    > for /home (or somesuch .. the rest of the user data), and another set
    > aside for experimenting with other distros.
    >
    > My understanding is that you can have at most 4 primary partitions.


    With a legacy BIOS, this is true yes - machines with an EFI BIOS do not have
    this limitation. However, an extended partition container is also a
    primary partition - one of the four available ones - and keeps a secondary
    partition table for logical partitions inside the container itself.

    You also do not need to have a primary partition in order to create an
    extended partition container with logical partitions. At least, not in
    GNU/Linux - DOS and Windows will typically not allow this because they need
    a primary partition to exist, for DOS to reside in, or for Windows to have
    its bootloader in - see above.

    > I'll waste one on Vista, one on... i think root for my primary
    > Linux installation. Does swap or /boot have to be on a primary
    > partition?


    Nope. You can install them in logical partitions. Be however advised that
    if you have a SAS, SCSI, SATA or USB hard disk - all of which use some
    implementation of the SCSI layer - the amount of partitions in total is
    limited to 15 per disk. IDE disks can hold up to 63 partitions in total.

    Although the following will not be applicable for your situation - given
    that you speak of a laptop - you must also keep in mind that if you're
    going to have disks in a hardware RAID array, the whole RAID array will be
    seen by the operating system as being one disk, and so the same limitations
    apply there.

    > It's just not going to add up if i need one for root, boot, swap,
    > Winbloze, and maybe another to for distro playing.


    I am currently in the process of setting up a rather complex installation on
    another machine. The idea is to run multiple Gentoo GNU/Linux
    installations - each of them with their own partitions and a far more
    extensive diversification of filesystems than in your intended set-up - for
    use as a virtual machine construct on top of the Xen hypervisor.

    This machine has four SAS hard disks, set up as a (hardware) RAID 5 array.
    Thus, the amount of partitions I can use on this machine is limited to 15,
    while I actually need far more. My workaround was to use LVM (Logical
    Volume Management).

    With LVM, you can create multiple pseudo-partitions inside an existing real
    partition (which doesn't hold a filesystem yet). I suggest that instead of
    using up real partitions from the start, you would do the following -
    presuming that the laptop's hard disk is on an SATA bus:

    - */dev/sda1* = Vista C: drive (primary partition, bootable)
    - */dev/sda2* = extended partition container
    - */dev/sda5* = Vista D: drive (logical partition, see *[1]*)
    - */dev/sda6* = stable GNU/Linux installation */boot
    - */dev/sda7* = stable GNU/Linux installation root filesystem
    - */dev/sda8* = Linux swap partition (see *[2]*)
    - */dev/sda9* = testing GNU/Linux root filesystem, see *[3]*)
    - */dev/sda10* = stable GNU/Linux */home* (see *[4]*)
    - */dev/sda11* = testing GNU/Linux */home*
    - */dev/sda12 = LVM (see *[5]*)

    *[1]* I recommend formatting this with /vfat/ - FAT32 in Microsoft-speak -
    so that you have a filesystem that can be read and written to by both Vista
    and GNU/Linux, in the event that you want to share certain files between
    both platforms. However, do _*not*_ use this as your */home*
    because /vfat/ does not support UNIX file ownerships and permissions.

    *[2]* When running other installations of GNU/Linux on the same machine for
    testing purposes, you can use the same swap partition as in your main
    installation, _provided_ however that you don't hibernate your system -
    i.e. "suspend to swap" - prior to booting another installation.

    *[3]* Since your intention is to only test other distributions, there is no
    need to diversify the filesystem hierarchy within such a test install, and
    so you can keep everything on the test distribution's root filesystem,
    except for */home* - see below.

    *[4]* Keeping your */home* filesystems separate allows you to reformat the
    */home* of a test distro while keeping your normal distro - which I've
    labeled "stable" in the above partitioning layout - secured. However,
    having it separated from the test distro's root filesystem allows you to
    install and reinstall that test distro (or another one) without having to
    reformat that */home* and lose your data. It's also easier if you want to
    copy or move data between the two installed distributions without needing
    to mount the other distribution's root filesystem.

    *[5]* Aside from keeping */boot* and */home* separate, I would also
    recommend having */usr,* */opt,* */var* and */tmp* separated. The former
    two are static filesystems, which should for good measure even be mounted
    read-only during normal system operation.

    */var* is a filesystem that's being written to a lot by your system's
    daemons - e.g. /syslogd,/ among others; it also contains print spools, for
    instance - and that you best keep separated from the root filesystem. In
    fact, the root filesystem itself should be kept quite small if you decide
    to split off sections of the filesystem hierarchy. Ideally, it should be
    no larger than 250-300 MB.

    */tmp* is similar to */var,* albeit that its contents are quite different.
    It mainly consists of sockets, and nothing in */tmp* should be expected to
    survive a reboot. It is therefore best - also for security reasons - to
    have */tmp* as small as possible, and I personally prefer having it exist
    on a /tmpfs/ rather than on the physical disk. /tmpfs/ is a swappable
    RAM-based filesystem that has its own mount options. See...

    man mount

    .... and...

    man fstab

    .... for details.

    Given your intended usage of the machine, I would thus install the above
    filesystems in logical volumes. You only need one partition for that,
    which you prepare for LVM usage with /pvcreate/ - see the /man/ page for
    details. This would be the equivalent step to creating a filesystem on it
    after having created the partition itself, but we're not quite there yet,
    because LVM is an abstraction layer above physical partitioning.

    After doing this, you create a volume group on it using /vgcreate/ - again,
    see the /man/ page for details - and then you create individual logical
    volumes in this volume group with /lvcreate./ You can then create
    filesystems on them in the usual way.

    Normally, the LVM package will install the proper tools for you and will set
    up your System V /init/ scripts so that a /vgscan/ is executed at every
    boot, through which the kernel will know about the logical volumes you have
    on your hard disk and output this information through /sysfs/ - mounted on
    */sys* by your System V boot scripts in any modern distribution - from
    which the /udev/ system can then retrieve the proper information to create
    the device special files for each logical volume and volume group in
    */dev.*

    You can then use these device special files - or eventually a filesystem
    label, or a UUID if you like - in */etc/fstab,* just as you would for
    regular partitions.

    It's an additional level of complexity, I admit. Yet it does offer an easy
    workaround for the partition number limit imposed by the legacy hardware
    design.

    Hope this was helpful. :-)

    --
    *Aragorn*
    (registered GNU/Linux user #223157)

  5. Re: primary partitions

    Jerry McBride wrote:

    > Time Waster wrote:
    >
    >>
    >> Which filesystems need to be primary partitions? I'm getting a new
    >> laptop, and will leave some for the Vista, another partition for /,
    >> another for /boot, another for swap, and another for /home (or somesuch
    >> .. the rest of the user data), and another set aside for experimenting
    >> with other distros.
    >>
    >> My understanding is that you can have at most 4 primary partitions.
    >> I'll waste one on Vista, one on... i think root for my primary
    >> Linux installation. Does swap or /boot have to be on a primary
    >> partition?
    >>
    >> It's just not going to add up if i need one for root, boot, swap,
    >> Winbloze, and maybe another to for distro playing.
    >>
    >> TIA!

    >
    > Swap can be on a logical partition... no problems. In fact, swap can be a
    > file too...


    Yes it can, but I wouldn't recommend it. It adds overhead to performance.

    > Boot? Unless someone else can chime in, /boot must be a primary partition.


    No, it must not. In fact, it can even be a logical volume, but this would
    preclude a number of installation scenarios - e.g. you cannot boot a kernel
    then without an /initramfs/ or /initrd/ - and then some versions of GRUB
    might refuse to work properly - LILO works fine, though.

    > Root? I'm not too sure about this one. I've always made them primary's...


    So do I, but that's only so I would have a consistent partition numbering
    scheme. GNU/Linux does not care about active, inactive, primary or logical
    partitions. UNIX never has, as far as I can remember.

    The need for a primary partition which is marked active stems from the
    paradigm of having the BIOS carry out its legacy boot routine, i.e. the
    BIOS finds out what medium the system must be bootstrapped from and then
    loads its bootsector into memory.

    Hard disks have partition tables - although this in itself isn't really a
    requirement either, but that's another debate ;-) - and so the partition
    table is read, and from that partition table, the primary partition marked
    "active" is selected, and its bootsector is read into memory. This
    bootsector is then where the bootloader for certain operating systems
    resides, e.g. MS-DOS, OS/2 (if used without its own bootloader) and all
    versions of Windows.

    (As I wrote in my reply to the OP directly, Windows itself can be installed
    in another partition - even one that's on another hard disk - but Windows
    always requires a "C: drive" to store its bootloader in, and "C:" is
    (through the same DOS and CP/M legacy) an active primary partition on the
    first hard disk approached by the BIOS at hardware boot time.

    GNU/Linux works differently. GNU/Linux uses a bootloader - on /x86,/ this
    is GRUB or LILO - which can be installed in the hard disk's MBR. Depending
    on the chosen bootloader, the bootloader will then directly load the boot
    menu and subsequently a kernel image into memory via raw logical block
    addressing (in LILO) or load an intermediary stage into memory which holds
    a real mode filesystem driver (in GRUB), through which then the boot menu
    and eventually the kernel is loaded via regular filesystem access from
    whatever filesystem it is on.

    In legacy proprietary UNIX systems, the bootloader used the same principles
    as LILO, although there - given the hardware of the time - instead of
    logical block addressing, cylinder/head/sector addresses were used. The
    first versions of LILO even looked just like those traditional bootloaders,
    i.e. just a boot prompt, without a menu.

    As such, UNIX and UNIX-like systems like GNU/Linux, GNU/Hurd or the various
    *BSDs do not care about the partition type or an "active" flag in the
    partition table.

    --
    *Aragorn*
    (registered GNU/Linux user #223157)

  6. Re: primary partitions

    Aragorn staggered into the Black Sun and said:
    > Jerry McBride wrote:
    >> Time Waster wrote:
    >>> Which filesystems need to be primary partitions?

    >> Swap can be on a logical partition... no problems. In fact, swap can
    >> be a file too...

    > Yes it can, but I wouldn't recommend it. It adds overhead to
    > performance.


    If you're hitting swap at all, you're having performance problems. The
    overhead of a swap file is AFAICT minimal on a workstation.

    >> Boot? Unless someone else can chime in, /boot must be a primary
    >> partition.

    > No, it must not. In fact, it can even be a logical volume


    /boot *CANNOT* be on an LV. Neither GRUB nor LILO are able to grok the
    complexities of LVM. /boot can be on a logical partition. The main
    requirement on the x86 is that all the sectors on /boot must be
    addressable by the BIOS.

    > but this would preclude a number of installation scenarios - e.g. you
    > cannot boot a kernel then without an initramfs or initrd


    ITYM "you can have / on any partition, or on an LV". You'll need an
    initrd containing device-mapper and the LVM2 toolset if your / is on an
    LV though.

    >> Root? I'm not too sure about this one. I've always made them
    >> primary...

    > GNU/Linux does not care about active, inactive, primary or logical
    > partitions.


    This is true.

    --
    "Bother," said Pooh. "Eeyore, ready two photon torpedoes and lock
    phasers on the Heffalump; Piglet, meet me in transporter room three."
    My blog and resume: http://crow202.dyndns.org:8080/wordpress/
    Matt G|There is no Darkness in Eternity/But only Light too dim for us to see

  7. Re: primary partitions

    On 2 Jun 2008 04:29:34 GMT, Dances With Crows wrote:

    > /boot *CANNOT* be on an LV. Neither GRUB nor LILO are able to grok the
    > complexities of LVM. /boot can be on a logical partition.


    Well, do not tell my system that. I had LILO booting my Mandriva 2008.1
    $ mount | grep lvm snippet follows:
    /dev/mapper/lvm1-1 on /lvm2008_1 type ext3


    > ITYM "you can have / on any partition, or on an LV". You'll need an
    > initrd containing device-mapper and the LVM2 toolset if your / is on an
    > LV though.


    As I misunderstand it, when you do a lilo -v, for instance, lilo
    hard codes the location of the kernel/initrd and that information goes
    in with lilo when it install into the mbr.

    Mandriva's initrd/kernel had the LVM module and was able to boot my install
    from my /dev/sdb logical volume.

    I kept running out of partitions on SATA drives multibooting several
    distributions. When with LVM hopping to get around the 15 partition
    limit for /dev/sdxX. Found out other distributions would not boot from
    a LVM install.

    Installed VirtualBox, and I now have no partition limits to worry
    with.

  8. Re: primary partitions

    on Monday 02 June 2008 13:57
    in the Usenet newsgroup comp.os.linux.hardware
    Aragorn wrote:

    > Jerry McBride wrote:
    >
    >> Time Waster wrote:


    Time Waster, that is an interesting name.

    [snip]
    >> Boot? Unless someone else can chime in, /boot must be a primary
    >> partition.

    >
    > No, it must not.

    [snip]

    Aragorn, it is obvious that you know the subject, but I think
    that that should read, "it need not", or , "it does not have to",
    rather than, "it must not".


    --
    sig goes here...
    Peter D.

  9. Re: primary partitions

    Peter D. wrote:

    > on Monday 02 June 2008 13:57
    > in the Usenet newsgroup comp.os.linux.hardware
    > Aragorn wrote:
    >
    >> Jerry McBride wrote:
    >>
    >>> Boot? Unless someone else can chime in, /boot must be a primary
    >>> partition.

    >>
    >> No, it must not.

    > [snip]
    >
    > Aragorn, it is obvious that you know the subject, but I think
    > that that should read, "it need not", or , "it does not have to",
    > rather than, "it must not".


    I know. :-) In proper English, it should indeed be "it need not" or "it
    does not have to", but I was deliberately using a (generally accepted)
    "artistic freedom" in replying to Jerry, when he said "it must be a primary
    partition". :-)

    Additionally, the reason as to why I was so sure that LILO would work if you
    have */boot* on a logical volume is that Bit Twister and myself also
    participate in at least two other groups, and I know of his success with
    such a set-up from over there. :-)

    GRUB on the other hand does not - or at least, not at present - understand
    logical volume management; this is true. The CentOS systems I've installed
    with logical volume management use GRUB as the default bootloader and they
    require */boot* to reside on a regular partition - which may be a logical
    partition in the extended partition container, though. ;-)

    --
    *Aragorn*
    (registered GNU/Linux user #223157)

  10. Re: primary partitions

    Bit Twister staggered into the Black Sun and said:
    > On 2 Jun 2008 04:29:34 GMT, Dances With Crows wrote:
    >> /boot *CANNOT* be on an LV. Neither GRUB nor LILO are able to grok
    >> the complexities of LVM. /boot can be on a logical partition.

    > Well, do not tell my system that. I had LILO booting my Mandriva
    > 2008.1. As I misunderstand it, when you do a lilo -v, for instance,
    > lilo hard codes the location of the kernel/initrd and that information
    > goes in with lilo when it install into the mbr.


    Hm. While this will work, since LILO relies on absolute sector
    positions for everything, then your /boot LV can't be treated as a real
    LV. Forget moving the /boot LV to an arbitrary PV, don't try to shrink
    the LV, etcetera. If you have to treat /boot as something other than a
    real LV, how much point is there to keeping it on an LV?

    > I kept running out of partitions on SATA drives multibooting several
    > distributions. [Went] with LVM hopping to get around the 15 partition
    > limit for /dev/sdxX. Found out other distributions would not boot from
    > a LVM install.


    If the other distros won't boot when / is on an LVM, something isn't
    right. Most distros are using GRUB by default now, so they would have a
    hard time if /boot was on an LV. But you could easily get away with
    using only 2 partitions for multibooting a bunch of different distros:
    A 100M or so /boot , and a 240G LVM PV containing a bunch of LVs.

    --
    "Oh bother," said the Borg, "We've assimilated Pooh."
    --MHR on alt.fan.pratchett
    My blog and resume: http://crow202.dyndns.org:8080/wordpress/
    Matt G|There is no Darkness in Eternity/But only Light too dim for us to see

  11. Re: primary partitions

    On 2008-06-02, Time Waster wrote:

    > Which filesystems need to be primary partitions?


    None with linux. The requirement that filesystems need to be on primary
    partitions for whatever reason is a Windows feature.

    > My understanding is that you can have at most 4 primary partitions.


    That a limitation of the x86 architecture.

    > I'll waste one on Vista,


    Install Vista first in a primary partition, on the first partition on
    the drive. Then install linux. You can do it the other way around, but
    Windows has a habit of overwriting other systems' boot records, which
    adds extra steps to correct.

    > one on... i think root for my primary Linux installation. Does swap
    > or /boot have to be on a primary partition?


    Nope. Neither does /. Just make a primary for Vista, then make the rest
    of the drive an extended partition containing logicalpartitions for /,
    /home, /tmp, and swap at least -- more if you like (e.g. /usr/local or
    /opt).

    --

    John (john@os2.dhs.org)

  12. Re: primary partitions

    On 2008-06-02, Jerry McBride wrote:

    > Boot? Unless someone else can chime in, /boot must be a primary partition.


    Nope. As long as your boot loader (lilo or grub or whatever) can use the
    MBR, /boot can be anywhere your BIOS can see.

    --

    John (john@os2.dhs.org)

  13. Re: primary partitions

    On 2008-06-02, Aragorn wrote:

    > Jerry McBride wrote:
    >
    >> Swap can be on a logical partition... no problems. In fact, swap can be a
    >> file too...


    > Yes it can, but I wouldn't recommend it. It adds overhead to performance.


    How so? Inquiring minds want to know...


    --

    John (john@os2.dhs.org)

  14. Re: primary partitions

    John Thompson wrote:

    > On 2008-06-02, Aragorn wrote:
    >
    >> Jerry McBride wrote:
    >>
    >>> Swap can be on a logical partition... no problems. In fact, swap can be
    >>> a file too...

    >
    >> Yes it can, but I wouldn't recommend it. It adds overhead to
    >> performance.

    >
    > How so? Inquiring minds want to know...


    The Linux kernel prefers its paged out memory to be on a swap partition,
    which has special formatting. A swap partition does not hold a filesystem
    and is accessed by the kernel's memory management routines directly.

    If on the other hand you opt for a swapfile - and this is indeed possible -
    then this swapfile would reside on a filesystem on a regular partition, and
    then the kernel would have to access the swapfile via the additional
    filesystem layer, and possibly - although I am not sure of this, since the
    Linux kernel developers are nifty guys - the location of the swapfile would
    have to be buffered/cached somehow, which reduces the available amount of
    free RAM.

    The intended use of swapfiles for the Linux kernel is the proverbial
    emergency scenario, when no real swap partitions are available and swap is
    needed. It is always advisable to use real swap partitions instead. ;-)

    --
    *Aragorn*
    (registered GNU/Linux user #223157)

  15. Re: primary partitions

    On 2008-06-02, Dances With Crows wrote:
    > Bit Twister staggered into the Black Sun and said:
    >> On 2 Jun 2008 04:29:34 GMT, Dances With Crows wrote:
    >>> /boot *CANNOT* be on an LV. Neither GRUB nor LILO are able to grok
    >>> the complexities of LVM. /boot can be on a logical partition.

    >> Well, do not tell my system that. I had LILO booting my Mandriva
    >> 2008.1. As I misunderstand it, when you do a lilo -v, for instance,
    >> lilo hard codes the location of the kernel/initrd and that information
    >> goes in with lilo when it install into the mbr.

    >
    > Hm. While this will work, since LILO relies on absolute sector
    > positions for everything, then your /boot LV can't be treated as a real
    > LV. Forget moving the /boot LV to an arbitrary PV, don't try to shrink
    > the LV, etcetera. If you have to treat /boot as something other than a
    > real LV, how much point is there to keeping it on an LV?


    You could do all of these things as long as you remember to run LILO
    before shutting down, otherwise you'd have rendered your machine
    unbootable.

    Not worth the risk, I reckon.

    I'll stick to having /boot on a primary.

    --
    Regards,

    Gregory.
    Gentoo Linux - Penguin Power

  16. Re: primary partitions

    On 2008-06-03, Aragorn wrote:
    >
    > If on the other hand you opt for a swapfile - and this is indeed possible -
    > then this swapfile would reside on a filesystem on a regular partition, and
    > then the kernel would have to access the swapfile via the additional
    > filesystem layer, and possibly - although I am not sure of this, since the
    > Linux kernel developers are nifty guys - the location of the swapfile would
    > have to be buffered/cached somehow, which reduces the available amount of
    > free RAM.


    [mouth opens in a surprised "o"]

    The purpose of swap is to get memory onto disk, to increase available
    RAM. There's no purpose to caching/buffering swap.. it's completely
    insane. What's the point of stuffing memory with the stuff that the
    computer wants to remove from memory and put on disk?

    Fairyland stuff!

    > The intended use of swapfiles for the Linux kernel is the proverbial
    > emergency scenario, when no real swap partitions are available and swap is
    > needed. It is always advisable to use real swap partitions instead. ;-)


    While I agree with your statements here, I'd like to see some actual
    figures regarding swapfiles vs partitions. From what I've heard, the
    filesystem overhead is not really that great.

    --
    Regards,

    Gregory.
    Gentoo Linux - Penguin Power

  17. Re: primary partitions

    On Tue, 3 Jun 2008, Aragorn wrote:

    > The intended use of swapfiles for the Linux kernel is the proverbial
    > emergency scenario, when no real swap partitions are available and swap is
    > needed. It is always advisable to use real swap partitions instead. ;-)
    >

    But given the huge amounts of memory many/most computers have nowadays,
    swap is relatively obsolete. Even if someone starts doing something
    that uses even more memory, the cost of adding more may not be considered
    a bother.

    Hence, a swap file may be fine for those instances when someone actually
    really needs swap, ie some specific purpose that is terribly memory
    intenstive. Then, they can live with the downsie of swap files, since
    it's temporary. But they don't have to allocate a partition for swap.
    (Admittedly, hard drives have gotten so big that anything allocated
    for a swap partition would get lost, but once you don't generally
    need swap, someone might not bother and then need the swap file
    for something that suddenly arises.)

    Let's not forget that it's all relative. Having enough RAM is
    better than swap, and a swap partition is better than a swap file,
    and a swap file is better than nothing.

    Michael


  18. Re: primary partitions

    Gregory Shearman wrote:

    > On 2008-06-03, Aragorn wrote:
    >>
    >> If on the other hand you opt for a swapfile - and this is indeed possible
    >> - then this swapfile would reside on a filesystem on a regular partition,
    >> and then the kernel would have to access the swapfile via the additional
    >> filesystem layer, and possibly - although I am not sure of this, since
    >> the Linux kernel developers are nifty guys - the location of the swapfile
    >> would have to be buffered/cached somehow, which reduces the available
    >> amount of free RAM.

    >
    > [mouth opens in a surprised "o"]
    >
    > The purpose of swap is to get memory onto disk, to increase available
    > RAM. There's no purpose to caching/buffering swap.. it's completely
    > insane. What's the point of stuffing memory with the stuff that the
    > computer wants to remove from memory and put on disk?
    >
    > Fairyland stuff!


    That is why I presume that the kernel guys have found a way around this
    problem. If however they somehow haven't, then there is no reason as to
    why the kernel would treat the swapfile any different from any other file
    on a filesystem.

    The above is basically one of the reasons UNIX has traditionally always used
    swap partitions.

    >> The intended use of swapfiles for the Linux kernel is the proverbial
    >> emergency scenario, when no real swap partitions are available and swap
    >> is needed. It is always advisable to use real swap partitions
    >> instead. ;-)

    >
    > While I agree with your statements here, I'd like to see some actual
    > figures regarding swapfiles vs partitions. From what I've heard, the
    > filesystem overhead is not really that great.


    It would certainly be less great than in Windows, but that still doesn't
    make swapfiles a preferable choice over swap partitions. Why do it the
    hard way if you can do it the easy way?


    --
    *Aragorn*
    (registered GNU/Linux user #223157)

  19. Re: primary partitions

    Michael Black wrote:

    > On Tue, 3 Jun 2008, Aragorn wrote:
    >
    >> The intended use of swapfiles for the Linux kernel is the proverbial
    >> emergency scenario, when no real swap partitions are available and swap
    >> is needed. It is always advisable to use real swap partitions
    >> instead. ;-)

    >
    > [...]
    > Let's not forget that it's all relative. Having enough RAM is
    > better than swap, and a swap partition is better than a swap file,
    > and a swap file is better than nothing.


    True, but I don't know exactly whether it's possible to hibernate your
    system - i.e. suspend to swap - via a swapfile. I don't use hibernation
    myself anyway, so I have no experience with it.

    Anyway, like you said - and which I have snipped out, sorry about that -
    hard disks are now so large in capacity that even a 2 GB swap partition
    won't make much of a difference in diskspace anymore anyway. ;-)

    --
    *Aragorn*
    (registered GNU/Linux user #223157)

  20. Re: primary partitions

    On Sun, 01 Jun 2008 22:26:14 -0400 Jerry McBride wrote:
    | Time Waster wrote:
    |
    |>
    |> Which filesystems need to be primary partitions? I'm getting a new
    |> laptop, and will leave some for the Vista, another partition for /,
    |> another for /boot, another for swap, and another for /home (or somesuch ..
    |> the rest of the user data), and another set aside for experimenting with
    |> other distros.
    |>
    |> My understanding is that you can have at most 4 primary partitions.
    |> I'll waste one on Vista, one on... i think root for my primary
    |> Linux installation. Does swap or /boot have to be on a primary
    |> partition?
    |>
    |> It's just not going to add up if i need one for root, boot, swap,
    |> Winbloze, and maybe another to for distro playing.
    |>
    |> TIA!
    |
    | Swap can be on a logical partition... no problems. In fact, swap can be a
    | file too...
    |
    | Boot? Unless someone else can chime in, /boot must be a primary partition.

    I've done boot with a logical partition. On older machines it had to be in
    the first 1023 or 1024 cylinders. But I did this before even in that case.
    I did this with LILO, not GRUB. I don't know if GRUB has any issues with
    logical partitions.


    | Root? I'm not too sure about this one. I've always made them primary's...

    Even easier. As long as the kernel can see the partition, it can mount it
    as root.

    I also have a kernel patch available that adds a new boot parameter called
    "rootdir=" which allows you to mount a subdirectory as / without the need to
    insert a "pivot root" program. It allows for easy switching to other run
    time root trees within the same filesystem (which can save space when most
    of the files are identical and hard linked between the trees).

    http://phil.ipal.org/linux/kernel/patch/rootdir/

    --
    |WARNING: Due to extreme spam, googlegroups.com is blocked. Due to ignorance |
    | by the abuse department, bellsouth.net is blocked. If you post to |
    | Usenet from these places, find another Usenet provider ASAP. |
    | Phil Howard KA9WGN (email for humans: first name in lower case at ipal.net) |

+ Reply to Thread
Page 1 of 2 1 2 LastLast