Oct 2, 2026, 23:50 by [email protected]:
> On Sat, Oct 03, 2026 at 04:42:46AM +0200, Jeff wrote: > >> Based on advice I got elsewhere, I would like to put an ext2 >> filesystem on an existing partition that I can share between NetBSD and >> Gentoo on a dual boot system. The advice was to create the filesystem >> from in NetBSD. >> > > I understand the MBR vs. disklabel vs. GPT confusion - it is a disaster > for historical raisins. > > The GPT start is most straigth forward and portable to other OSes: > > If you have a disk with GPT it will autoconfigure wedges. So if your > device is, say, sd0 you can list all wedges with: > > dkctl sd0 listwedges > > If your partitions have usefull GPT labels, this should be enough to > identify them. Example form one machine here: > > # dkctl wd0 listwedges > /dev/rwd0: 2 wedges: > dk0: G5root, 943718400 blocks at 64, type: ffs > dk1: G5swap, 56496704 blocks at 943718464, type: swap > > my root file system is labeled "G5root", so I can acces it as dk0. > > Without label you need to rely on "type", which might not be unique. > Worst case you get a UUID, and then you may compare it to > Ah, thank you! This gives me: # dkctl ld0 listwedges /dev/rld0: 7 wedges: dk0: d4366365-dfba-42c6-aa86-8bd13f5d0564, 2097152 blocks at 2048, type: msdos dk1: 05a01071-6bc1-481f-b659-a0373ab6d6c8, 33554432 blocks at 2099200, type: dk2: 8cf0d625-ed6e-4d4c-9b61-90831ca84c85, 734003200 blocks at 35653632, type: dk3: b5bff367-4977-4887-bea0-7e42f7a04fe4, 104857600 blocks at 769656832, type: ext2fs dk4: c5c7b576-62b3-4a28-b174-8368cd4e15ec, 419430400 blocks at 874514432, type: ext2fs dk5: f2a6aa99-c65c-4391-925a-97e1ff80a60c, 33550336 blocks at 1293946880, type: swap dk6: 985d1633-acd7-41c3-b91e-393708c41710, 672909967 blocks at 1327499264, type: ffs I can tell just from this that dk3 is what I want to work with. > > gpt show -a sd0 > > output (again assuming your disk is sd0). > 769656832 104857600 4 GPT part - Linux data Type: linux-data TypeID: 0fc63daf-8483-4772-8e79-3d69d8477de4 GUID: b5bff367-4977-4887-bea0-7e42f7a04fe4 Size: 51200 M Label: Attributes: None Huh. But in this output, the index of the device I want is 4. So I need to remember not to use the index from this gpt command (which I quite like the output of), but rather the device name from the dkctl command. By the way, I remember that NetBSD called my SSD 'ld0' in the installer. If I didn't remember that, or if I was working with a system that I didn't install, how would I determine the name of the hard drive? > > Once you know the N for your target dkN device, you can create an ext2fs > file system on it using newfs_ext2fs(8) like: > > newfs_ext2fs -v "myVolume" /dev/rdk0 > > (if your dkN from the search above is dk0) > Okay, so I would be working with /dev/rdk3 then? Where does that 'r' come from? Thanks much! Jeff
