NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: BSD disklabel partition letters in NetBSD



    Date:        Thu, 4 Oct 2018 22:14:31 +0200
    From:        "Rocky Hotas" <rockyhotas%post.com@localhost>
    Message-ID:  <trinity-24e9ec90-20ad-42c1-b952-7ab4dae4ea79-1538684071967@3c-app-mailcom-lxa07>

  | > Sent: Thursday, October 04, 2018 at 9:10 PM
  | > From: "Don NetBSD" <netbsd-embedded%gmx.com@localhost>

  | > I've never tinkered with moving swap out of 'b' -- but imagine it could be
  | > done, reliably.
  |
  | According to some previous messages, it should: it is non-conventional, but
  | not forbidden.

You can put swaps space in any partition you like, and have as many of them
as you like - and swap into files from filesystems mounted in ffs (and probably
other) partitions as well.   None of that is an issue.   You can also have no
swap soace if you want (and have enough RAM for what you need to run).

What you might want o be careful about is using partition b for something other
than swap.   That should work as well, there's nothing truly magic about 'b',
but there is just a possibiliity that some script, somewhere, mighht simply
assume that if it needs to add some swap space, it might just decide to simply
use the b partition, if one exists, without asking first, and destroy anything
else that is there.

  | Oh, actually you are right, it shouldn't be needed to duplicate also the
  | swap partitions, even because the amount of RAM is the same.

The one case wherte it is needed (to have 2 different swap areas) would be
is system A was to be a XEN Dom 0, and system Bis to be a DomU client
(or vice versa of course) - that is, when both systems are to be running at
the same time,

Or you can simply use both swap partitions if you want, on either system if
it is running alone - using one of them normally, with the other available
just in case more swap space is needed (I wouldn't advise simply using
both with equal priority, the swpped data would be all over the place, 
resulting in excessive drive head movement, and slower operations - unless
all this is on an SSD of course).

  | Ok, thanks for clarifying this. It was still a confusing issue, because
  | sometimes (also in sysinst(8)) when the BSD disklabel contents is shown, also
  | the mountpoints were listed, as if this information were stored in the
  | disklabel. But instead:

Where to mount things is in the fstab in the root, wherever that is - certainly
not in the disklabel - but the filesystem (at least ffs filesystems) do 
contain a "last mounted on" field.   This isn't used for much, though fsck
will print it, and it can be useful if you lose your fstab file and need to
attempt to remember which partition had which filesystem on it (not such
a big issue when you have just root and home (and swap) but when you
have many filesystems it can help.

One thing to watch when mixing NetBSD and FreeBSD - FreeBSD disklabels
(which would be in the FreeBSD root partition normally, just as the NetBSD
one is) are relative to the MBR partition (or slice) - NetBSD labels always
number sector 0 on the disk  as sector 0 in the label, and count from there,
the MBR partitioning info is used only to locate the NetBSD label (and if there
isn't one found, to create a fictional one in the kernel.)  FreeBSD treats
(or did last time I looked) MBR partitions (slices) as if they were different 
drives.

If you want to put both NetBSD and FreeBSD on the same drive, then I'd
suggest using MBR partitions as a way to keep yourself sane.

kre



Home | Main Index | Thread Index | Old Index