# Partition help



## pbrazendale (Mar 8, 2022)

Hi,

Another newbie question in relation to BSD, on linux as i have 32gb ram i don't use SWAP as never needed it, i also use a EFI partition for /boot, can i just get away with a '/' root partition in BSD like i do in linux? Surely the file system structure is the same?

The manual makes reference to separate partitions for /usr and /var etc, but surely i can just have one large '/' root partition like i currently do under linux?

Thanks and sorry if it's a basic question.


----------



## ralphbsz (Mar 8, 2022)

pbrazendale said:


> ... on linux as i have 32gb ram i don't use SWAP as never needed it, ...



I've personally never run FreeBSD without a swap partition. There are lots of discussions here on the Forum whether swap is needed in practice or not. The answer certainly depends on your workload. If you run a feature-rich DE with lots of programs, in particular known memory hogs (like browsers with lots of tabs open), it might be a good idea. You can always try starting without swap, and adding a swap file (in your file system) later if needed.

For the rest of the discussion about partitions, there is a more basic question: Do you want to install with root using UFS (which uses traditional partitions for each separate file system), or with root using ZFS? I know know root-on-ZFS second hand, but I think it by default uses a single partition for all file systems, which it turns into a single ZFS pool, and then it creates multiple ZFS "file systems" within that one pool.



> ... can i just get away with a '/' root partition in BSD like i do in linux? ... The manual makes reference to separate partitions for /usr and /var etc, but surely i can just have one large '/' root partition like i currently do under linux?



When you say "one large root partition", what you really mean: one large single file system, using one partition, mounted at '/'. It's about file system, not partition; the partition is a means to an end here.

Yes you can. Whether it is a good idea depends on your intended use of the system, how well you understand your requirements, and whether you're comfortable managing it fine-grain. Having separate file systems is traditional (and the handbook is quite traditional, at times old fashioned). It comes from the times when disks were very small, and it would be expected that file systems run out of space regularly. At that point, creating a fixed-size partition for really important things (like /var) is a good safety measure. But it requires understanding your needs really well, so you can efficiently decide the size of these file system.



> Surely the file system structure is the same?


No, it surely is not. The single biggest difference is that in FreeBSD, a lot of software that's not part of the base system is installed in /usr/local. But the FreeBSD directory hierarchy is well documents (as are most things in FreeBSD), for example in "man hier".


----------



## pbrazendale (Mar 8, 2022)

Thanks for advice very helpful it’s going to be a learning curve but willing to give it a go, going to do an install shortly and see how we go.


----------



## grahamperrin@ (Mar 8, 2022)

pbrazendale said:


> Thanks for advice very helpful it’s going to be a learning curve but willing to give it a go, going to do an install shortly and see how we go.



Long term possibilities: if ever you need the OS to automatically store information relating to a kernel panic (system crash), the OS will need a suitable medium for storage, and that medium is normally the swap partition. 



pbrazendale said:


> … 32gb ram …



Size the partition accordingly.


----------

