DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD Installation and Upgrading

FreeBSD Installation and Upgrading Installing and upgrading FreeBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 12th January 2009
Mantazz Mantazz is offline
Shell Scout
 
Join Date: Oct 2008
Posts: 90
Default Is partitioning still important in installation?

This is somewhat of a general question though for me it relates most directly to my FreeBSD webserver at home.

Do people still partition their hard drives when setting up FreeBSD? When I used to manage several FreeBSD systems it was standard operating procedure to partition the drive upon installation; most of the space going to /usr, about 20% to /, and maybe 10% to /var.

Do people still do this? I have noticed that Linux installs have gone to single partitions, but what about our BSD installs? Are partitions still important, or do people just give their entire hard drives to the OS in a single slice now?
Reply With Quote
  #2   (View Single Post)  
Old 12th January 2009
Oko's Avatar
Oko Oko is offline
Rc.conf Instructor
 
Join Date: May 2008
Location: Kosovo, Serbia
Posts: 1,102
Default

It is VERY important of course. Lots of security measures can not be implemented
when you have only single partition /.

On OpenBSD I have at least / , /swap, /tmp, /var, /usr, /home .
Swap is 2xRAM and is crypted by default on OpenBSD, /tmp and /var are mounted with noexec options. / is mounted with read only option.
You probably want to put at least 3xswap for var in the case of the core damp.
The size of /var, /usr, /home depends on purpose. If you are running mail serer
obviously /var would have to be very big. If you are running file server at a
university /home it will have to be big.

If you are running something as chrooted I would put it on the separate partition.
On OpenBSD if I install Linux applications they their partition is mounted separately.

So on and so forth.
Reply With Quote
  #3   (View Single Post)  
Old 12th January 2009
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Default

My very simple machine:
Code:
Terry@vectra$ uname -a
OpenBSD vectra.launchmodem.com 4.4 GENERIC#1021 i386
Terry@vectra$ df -h
Filesystem     Size    Used   Avail Capacity  Mounted on
/dev/wd0a      147M   43.5M   96.4M    31%    /
/dev/wd0h      393M   36.0M    337M    10%    /home
/dev/wd0d     98.3M    6.0K   93.4M     0%    /tmp
/dev/wd0g      6.7G    773M    5.6G    12%    /usr
/dev/wd0e      148M   39.4M    101M    28%    /var
/dev/wd1a     11.8G    109M   11.1G     1%    /usr/local
/dev/wd1d     44.3G   11.8G   30.3G    28%    /srv
Terry@vectra$

partitioning really yields a lot of possibilities, J65nko and others have made several good posts about what can be done.
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.
Reply With Quote
  #4   (View Single Post)  
Old 12th January 2009
Mantazz Mantazz is offline
Shell Scout
 
Join Date: Oct 2008
Posts: 90
Default

Quote:
Originally Posted by Oko View Post
It is VERY important of course. Lots of security measures can not be implemented
when you have only single partition /.

On OpenBSD I have at least / , /swap, /tmp, /var, /usr, /home .
Swap is 2xRAM and is crypted by default on OpenBSD, /tmp and /var are mounted with noexec options. / is mounted with read only option.
You probably want to put at least 3xswap for var in the case of the core damp.
The size of /var, /usr, /home depends on purpose. If you are running mail serer
obviously /var would have to be very big. If you are running file server at a
university /home it will have to be big.

If you are running something as chrooted I would put it on the separate partition.
On OpenBSD if I install Linux applications they their partition is mounted separately.

So on and so forth.
I neglected to mention the swap partition - really it is so ingrained in me (at 2x ram) that I even do it in windows.

The security advantages of partitioning I guess I had forgotten as well. Although my poor little web server really does so little serving (and has so little to serve) that I think I can survive with it setup as it is (currently just partitions for /, /usr, /var, and swap)?
Reply With Quote
  #5   (View Single Post)  
Old 13th January 2009
bichumo bichumo is offline
Port Guard
 
Join Date: May 2008
Posts: 21
Default

Don't understand the purpose of partitioning to /usr, /home, /var etc... It makes a lot of trouble when you need to recover data from damaged disks or smth. It also makes trouble when you need to enlarge one of them. For example in my oppinion for mail server with 8 HDD it's better to use 2xHDD (hw RAID-1) and make just / and swap, and with other 6 HDD make hw RAID-5 and mount it somewhere to /data for example. It depends on what you will run on server (mail server, web, db etc...), but I never make more than "swap" and "/".
Reply With Quote
  #6   (View Single Post)  
Old 13th January 2009
phoenix's Avatar
phoenix phoenix is offline
Risen from the ashes
 
Join Date: May 2008
Posts: 696
Default

You can tell who runs special-purpose servers, general-use servers, and desktops.

For desktops, there's not really any use to having more than / and swap, although I still use /, /usr, /usr/local, /home, /var, and swap. I like to keep the core OS (/) separate from the OS (/usr) separate from the ports (/usr/local) separate from user data (/home).

For servers, you gain a lot of flexibility by partitioning things based on where disk usage is expected. Sure, you have to do some up-front planning, and may have to re-do things down the line, but the benefits greatly outweigh the risks. And now, with ZFS, things get even better, as you can have individual filesystems for just about everything, tailored to their specific uses.

For example, you can make /usr/src separate, and enable compression since it's mostly text files. And make /usr/obj separate without compression. Same with /usr/ports and /usr/ports/packages. And then give each user their own filesystem, with different quotas and reservations. And so on. Very powerful, flexible, useful stuff.

So, it all comes down to "how will your disk space be used".
__________________
Freddie

Help for FreeBSD: Handbook, FAQ, man pages, mailing lists.
Reply With Quote
  #7   (View Single Post)  
Old 14th January 2009
cajunman4life cajunman4life is offline
Real Name: Aaron Graves
Package Pilot
 
Join Date: May 2008
Location: Coolidge, Arizona
Posts: 203
Default

I'll take a moment to throw my $0.02 in favor of partitions, no matter what the purpose of the machine is. I'll share with you this little story for an explination:

A while back I built a FreeBSD workstation. I did a single / partition (and a swap partition) on a 160GB drive, thinking I really shouldn't do it that way, but figured it would only be temporary. I should have stopped right there, as that was the first time I've done a single / partition...

One long compile gone awry later (matter-of-fact, I was building openoffice.org-3), and the machine locked up somehow. Power-cycle, and upon boot-up the system complains that / was not unmounted properly, and advised me to run fsck manually. Long story short, fsck was never able to fully fix the corruption, and the system was never able to return to full operation. So, I booted with a fixit cd, tarred and copied my home directory, and both etc's (/etc and /usr/local/etc), and gathered a list of software I had installed (ls /var/db/pkg > softlist). Built the system with proper partitions, restored my home dir and the etc's, and started re-building all the ports I had installed.

Since then I've managed to lock the system up a few times, and when I reboot I go to single user, and use "fsck -p" and everything is fixed and the system returns to normal.

So, I'd say be very, very careful with using a single partition. I'm thinking most linux distros use a single partition by default now due to having journaling filesystems (where hopefully there won't be as many inconsistencies after a crash).
__________________
I just saved a bunch of money on my car insurance by fleeing the scene of the accident!
Reply With Quote
  #8   (View Single Post)  
Old 14th January 2009
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Banned
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Default

+1 partitions.

I think it's silly to dismiss the added benefits of separate partitions.. I understand a first time user creating a large / initially, but it shouldn't become a habit.
Reply With Quote
  #9   (View Single Post)  
Old 14th January 2009
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,125
Default

http://www.openbsd.org/faq/faq4.html#Partitioning mentions several things to consider in partioning your disk.

Another thing to keep in mind is the memory needed for a fsck. From the same OpenBSD faq:
Quote:
fsck(8) time and memory requirements

Another consideration with large file systems is the time and memory required to fsck(8) the file system after a crash or power interruption. One should not put a 120G file system on a system with 32M of RAM and expect it to successfully fsck(8) after a crash. A rough guideline is the system should have at least 1M of available memory for every 1G of disk space to successfully fsck the disk. Swap can be used here, but at a very significant performance penalty, so severe that it is usually unacceptable, except in special cases.
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
Old 14th January 2009
bichumo bichumo is offline
Port Guard
 
Join Date: May 2008
Posts: 21
Default

A little bit offtopic. Is there any difference between such configuration:
1) In FDISK Partition editor create two slices with desc "freebsd"
In disk label editor for the first slice create: / /home /usr /var etc... and for the second create swap.
2) In FDISK Partition editor create one slice with desc "freebsd"
In disk label editor do everything as usual /, /home, /usr, /var, swap, etc...

Is there really any necessity to go by first way? I've heard that some people are going this way and says it's more secure to keep swap in different slice.
Reply With Quote
Old 14th January 2009
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,975
Default

I don't see much gain -- security or otherwise -- by having multiple MBR partitions for a BSD, as opposed to some other systems, such as Linux or Windows. That's because BSD manages disk partitioning through a single disklabel anyway. (As for performance, an I/O is an I/O: it points to a sector or a set of sectors on a drive by LBA number.)

Partitioning (either MBR or disklabel) is a logical way of separating contiguous chunks of sectors. The only benefit I can see to multiple MBR partitions for a BSD would be to help you to manage two discontiguous chunks of disk space that are used by the same BSD. However, you could still address discontigous chunks via the disklabel anyway, and ignore MBR tables.

Not all BSDs allow multiple MBR partitions -- OpenBSD, for example, allows only one A6 (OBSD) MBR partition at a time. If you need to manage discontigous areas, you either reconfigure the drive so the data resides in a single MBR partition, or you manage them via disklabel(8). When I first began to build test OpenBSD systems on a single workstation, I didn't have much experience with OpenBSD, so I managed multiple systems with fdisk. Within a very short period of time, I switched to managing things with disklabel, where partitioning was considerably more flexible. I still use disklabel today, when I need to multiboot different OBSDs.

MBR partitioning is still important: for the boot sequence, or for mounting foreign file systems.
Reply With Quote
Old 15th January 2009
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,125
Default

OpenBSD allows partitions a-p ( 16 for the whole disk). FreeBSD disklabel allows 8 labels (a-h) for a slice (MBR partition).
For a fine grained partition scheme, needing more then the 8 labels of which 3 (a, b and c), already have been taken, your only resort is too use a second slice (MBR partition).
For one of my favorite partition schemes on FreeBSD I have to use a second slice:
  1. s1a: root
  2. s1b: swap
  3. s1c: reserved for the whole FBSD slice
  4. s1d: /usr
  5. s1e: /usr/ports
  6. s1f: /home
  7. s1:/tmp
  8. s1:h:/var/tmp
  9. s2a:/var
  10. s2b: /iso

Of course with the new FBSD gpt partition scheme this limit will be things of the past
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
Old 15th January 2009
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Tcpdump Spy
 
Join Date: Apr 2008
Location: Netherlands
Posts: 2,243
Default

Quote:
FreeBSD disklabel allows 8 labels (a-h) for a slice (MBR partition).
FreeBSD 6.4 and 7.1 (Or newer) allow 26 labels.
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
Old 16th January 2009
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,125
Default

Carpetsmoker, that is what I thought too, but IIRC a 7.1BETA install didn't allow me to create more partitions than 8
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
Old 16th January 2009
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Tcpdump Spy
 
Join Date: Apr 2008
Location: Netherlands
Posts: 2,243
Default

You're right, I looked at:
http://www.freebsd.org/cgi/cvsweb.cg...bel/bsdlabel.c

Version 1.113 has 26 label limit, but 6.4 and 7.1 are versions 1.110.2.2.6.1 and 1.112.6.1, I mislooked earlier.

Guess we'll have to wait until FreeBSD 8 ...
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
partitioning scheme for a firewall? Timmy66 OpenBSD Security 1 19th September 2009 01:28 PM
AMD64 - Hard Drive Partitioning Turquoise88 General software and network 8 11th September 2009 05:58 AM
Important Announcement from International Earth Advisory Board robbak Off-Topic 3 11th September 2008 05:01 PM
freebsd 7 64 bit installation ijk FreeBSD Installation and Upgrading 9 1st September 2008 03:16 AM
Remote Installation of *BSD JMJ_coder Other BSD and UNIX/UNIX-like 3 21st August 2008 02:19 PM


All times are GMT. The time now is 06:38 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick