Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 279
  • Last Modified:

Disk partitioning questions

Hi,

I am a complete Linux newbie and I have a couple of questions to ask.

1) /boot mount point

a) what is it used for?
b) what should be the size?

2) If I have only one physical harddisk, should I just partition it to a / and a /swap partitions or should I give seperate partitions to things like /usr, /home, etc.?

3) If I sized my /swap partition to twice the size of my RAM and I increased my RAM later.  Should I also increase the size of my /swap partition?  If yes, how to I resize the partition?

Thanks.

Regards,
Kok Hee
0
KokHee
Asked:
KokHee
  • 2
1 Solution
 
barnskiCommented:
The /boot mount point is a filesystem that contains the files necessary to boot the system, including the kernel.
A decent description of the Red Hat boot process can be found at:
http://www.redhat.com/docs/manuals/linux/RHL-8.0-Manual/ref-guide/s1-boot-init-shutdown-process.html.

To start a Linux system, you need the minimum three partitions, which are:
/boot
/
swap

Any other filesystems (/var, /usr etc.) will be created under / on the same filesystem.
For advanced use, it's sometimes best to place /var on it's own partition (or "slice") of the disk, as /var can be filled with logfiles and dumps from badly configured apps. Clearly if it is on its own partition that is then mounted under /, it can't fill the / filesystem because it can only fill the mounted disk partition.
However, at home, on a PC, I have always created only the 3 partitions mentioned, as it gives you much more flexibility in how you use your disk space without having to change the partition table.

The size of /swap should be approximately RAM x2, but if you add more physical RAM, the system will still boot. If you really feel you want to increase the swap partition size, Linux is quite helpful. I have only done this on Red Hat, and only for ext3 partitions (not swap), but they provide a utility called "parted" (partition editor), which allows you to resize partitions.
However, you cannot resize a mounted filesystem, so to resize / and swap, you need to boot into rescue mode from the CDROM, and NOT mount your filesystems. You can then run parted and resize your partitions.
More details on parted at:
http://www.redhat.com/docs/manuals/linux/RHL-8.0-Manual/custom-guide/ch-disk-storage.html

Sorry the tips are so geared towards Red Hat, but that's what I use!!

Good luck, and persevere: Linux is worth it :)


0
 
KokHeeAuthor Commented:
Hi,

Thanks for the advice.

I didn't know any better when I loaded my system and I did not create a /boot partition.  It seems o.k.  How big should the /boot partition be?

Thanks.

Regards,
Kok Hee
0
 
barnskiCommented:
Again, I only really know Red Hat, but they recommend that /boot is at least 75MB for Red Hat 8.0.
If you have space, I would suggest 100-150MB would be fine.
Also, note that due to BIOS restrictions, the /boot partition generally needs to be within the first 1024 cylinders of the hard disk, or the system won't boot. It's therefore best to make /boot the first disk partition.
0
 
mjreganCommented:
I don't know why Red Hat would even want that much space for the /boot partition. The only thing that should be in there is the secondary boot loader, and the kernel. 75M is more than enough.

There are some good reasons for puting /usr and /home in seperate partitions. The biggest is that it stops you from doing too much damage when you enter rm *.* :< (Been there - done that). The rm command doesn't cross partitions. There are other reasons also. The /home directory in particular should have its own partition. Otherwise it will keep taking space from the / partion. This can lead to the system becoming unusable due to a lack of disk space.

The size of the partitions will depend on the distro. Not being familiar with Red Hat I am not sure what sizes they recommend. Most of the files will be in the /usr partition.

I have always found resizing partitions to be a pain even with two drives. If you have the room start with a larger swap partition. The old rule of twice your RAM really doesn't apply any more.
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now