> During a casual discussion about installing Solaris, > it was suggested that for > a single user system for personal use, that you could > just use a single partition / > Then you never have to worry about allocating too > little or too much disk space. > Any thoughts? My concern was the swap partition.
As long as the boot filesystem is ufs rather than zfs (the latter doesn't support the following), one can create a regular file on the ufs partition using the mkfile command (see the man page for it) and use that for swap. If one needed more, one could reboot to single-user mode, run swap -d pathname (to free it up), and delete the file and run mkfile again to make it larger. There's an option to mkfile to create a "sparse" file, but IMO that's not a good idea because if you run low on space and then get tight on swap too, the system won't be able to allocate actual storage to the swap file; I'm not sure what would happen then, but it might get you into a bit of a jam. There would always tend to be at least two partitions: 0 (your filesystem partition) and 2 (the whole disk, or on x86, the whole fdisk partition for Solaris, of which the individual Solaris partitions (or "slices", to distinguish) would all be a part, a little like how logical paritions are within an extended partition at the fdisk level. Partition 2 overlaps all the other Solaris partitions (slices); this is normal, and normally the _only_ case where overlap is legitimate. Conventionally, if you had a swap partition (slice), it would be partition 1, although it doesn't absolutely have to be. Usually though, I'd tend to prefer a separate swap partition, unless I was extremely tight for space, or had absolutely no clue how much swap I might need later on. There are two reasons for that: * crash dumps can go to a swap partition, but AFAIK not to a swap file; handy if you need them to figure out a major problem, or if you're doing something like driver development that may cause a few more crashes than usual * swap partitions are likely to perform a little better than swap files If I were to be considering setting up zones, I might want more partitions, for either more delegation (unusual but perhaps possible) or for better confinement or resource control. Even without zones, some people like to make /usr, or /var, or both separate (/var is by definition fairly volatile; /usr can be read-only to NFS diskless clients and the like). Some people also like to make /export/home and/or /export/opt (i.e. wherever they put all the stuff that didn't come as part of their Solaris installation) on separate partition(s), so that they can do a re-install rather than an upgrade and not lose any local data or apps (although a re-install would mean reconfiguring various OS stuff, re-doing certain tweaks, etc). Those are some of the reasons for different choices, there are probably plenty more I didn't mention or even think of. If you don't care about crash dumps and aren't worried by the slight loss of performance for swapping on a regular file, one partition would probably be good enough for a one-person system like you described, depending on whether you might care about such things later on. I might tend to create three partitions anyway: one for system stuff (/, /usr, /var, and so on), one as maybe /export/local for local data (with subdirectories for home, opt, etc, that one would automount), and one for swap (larger than I needed, so I could slice it differently later without having to mess with /, and with its storage right after that for local data, so I could move the boundary between the two and grow the local partition at the expense of swap; (keeping in mind that swap must not be in use when you do that, and you would then need to run growfs (assuming it's ufs) on the local partition). OTOH, if I knew I wouldn't need to rearrange anything, I'd set them up so the storage (unrelated to the partition number)of swap was at the beginning of the disk (or fdisk partition), followed by root, followed by any others; that seems to be the newer convention on the theory that swap is more efficient at the beginning of the disk. I don't know that I buy that theory - seems to me the middle of the disk is closer to a random location than either end is - but I think that's what the installer does these days if you let it set up the swap partition. If you _are_ using bootable zfs (don't know that I'd go there yet myself), you'd want two partitions (unless you had so much RAM you'd never need swap at all, and didn't care about crash dumps): one for a minimal (and non-redundant :-( ) zpool, and one for swap. Since zfs filesystems are very lightweight and take their storage from an existing zpool, you could create separate filesystems any time without worrying about partitions. (although I don't have clue one what an upgrade let alone a re-install with a zfs root would look like...not sure if you could do a re-install and still preserve local data...) But as long as you're willing to back up all your local data (separately from system directories and files!) and restore it after a re-install (or regard it as expendable anyway...some people do...), and just want the simplest (and most short-sighted) approach, one partition is ok... Probably too much information, but IMO you need to think about not only what you want right now, but what you might want later on without having to totally start over. This message posted from opensolaris.org
