Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11
hi all, i have been using linux for 2 years, & until now i'm not so familiar with disk partitions! i always managed to create a "/" & "swap" partitions ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    May 2003
    Posts
    8

    disk partitioning


    hi all,
    i have been using linux for 2 years, & until now i'm not so familiar with disk partitions! i always managed to create a "/" & "swap" partitions ...
    can you explain me what every partition do & used for? & when such a partition is needed?



    thnx a lot

  2. #2
    Linux Enthusiast
    Join Date
    Feb 2003
    Location
    Ontario, Canada
    Posts
    556
    well, those are the two basics, anything else you create (primary) can be salvaged in case you want to try something else.

    most commonly people tend to create separate partitions for /home and /usr if they do at all.

  3. #3
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    In former days, you had to have a boot partition first on the drive, since BIOSes without LBA support couldn't read the kernel if it was further into the disk than the 1024th cylinder. Nowadays, all BIOSes support LBA anyway, so that's not a worry.

    It can be a good thing to create a partition for /home, so that if you want to try a new distro, you can just format the root partition and still keep your home directory and all the settings in it. As for me, I mount /home over NFS, and on the server it is a LVM volume that spans two hard drives. I didn't combine it with the root filesystem, since that would complicate maintenence enormously.

    If you want a high-security system, you might want to have a seperate partition for /tmp. Since many, if not most, worms put executables in /tmp which it later runs, it's good to be able to mount /tmp with noexec.

    Noone wants a seperate partition for /usr. In the 70s, UNIX was distributed on two tapes, one root tape and one usr tape. The idea was that the root tape would be small and easy to set up, and then the usr tape was mounted on /usr once the system was up. That's not an issue anymore, so noone should ever create a /usr partition. In the GNU system, /usr is even symlinked to /. The legacy behaviour is still used, though. Only what is required to boot and maintain the system is put in the root filesystem, everything else (like user applications and the like) is put in /usr. If you have several computers, you could consider putting /usr on NFS to make all of them behave exactly the same.

    If you have two hard drives or more, you might want to put a swap partition on each of them. That way, the kernel can optimize the swapping speed by striping the swap over all the swap partitions.

  4. #4
    Linux User
    Join Date
    Jun 2003
    Location
    Huntington Beach, CA
    Posts
    390
    This is a little off topic but what is the purpose of the swap partition?

  5. #5
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    You don't know what swap is?
    When the processes in your system together map more memory than you actually have in RAM (which they often do), the kernel puts unfrequently used memory pages in the swap partition (it swaps the pages out), and then, when the process wants to read from the pages again, the kernel just swaps them in again. It's all transparent to the process itself. When the kernel swaps out pages, it marks the pages to the processor as inaccessible. Therefore, when the process tries to read from the pages again, the processor generates a page fault, which the kernel catches. When it does, it looks up the right page in the swap page and loads it into a physical memory (RAM) page, which it then remaps into the process' addressing space, and then it lets the process continue. To the process it appears as if nothing ever happened.
    Therefore, swap allows programs to use more memory than you actually have.

  6. #6
    Linux User
    Join Date
    Jun 2003
    Location
    Huntington Beach, CA
    Posts
    390
    Thanks for clearing that up. I sort of had an idea before but that puts it into perspective..

  7. #7
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    LOL! Now that I look at it afterwards, I find it rather funny that I was just blindly assuming that everyone would know what swap is and how it works. Maybe that's a sign of spending too much time by the computer... =)

  8. #8
    Linux User
    Join Date
    Jun 2003
    Location
    Huntington Beach, CA
    Posts
    390
    You can NEVER spend too much time in front of the computer. Unless your hand becomes perminetly glued to the mouse and the carpel tunnel has taken over so badly your hands and fingers are forever stuck in the home row position

  9. #9
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Speaking of the mouse; isn't it time to do something about that. I really hate the mouse. The only thing I use it for is for web browsing, and I'd really like to get rid of that dependency. Can't anyone think of a more practical means of navigating web pages? Admittedly, it isn't very practical to have to tab around all the elements to get where you want.

  10. #10
    Linux User
    Join Date
    Jun 2003
    Location
    Minnesota, USA yes.....
    Posts
    479
    lynx lol

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •