NetBSD-Users archive

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

Re: Sharing data between Debian and NetBSD on the same machine





El 13/1/26 a las 15:56, beaker escribió:
Ramiro Aceves <ea1abz%gmail.com@localhost> wrote:

After some time using and understanding NetBSD, I have been gaining
confidence with the OS. I would like to progressively increase the
importance of the tasks that NetBSD handles on my primary amd64
daily-work machine (an Intel NUC 8i7BEH).

I have been a happy Debian user for 25 years and have accumulated around
100 GB of genuinely useful data (schematics, web pages, programs, music
scores, office work, RF electronics designs, simulations, PCB designs,
documents, audio files, etc.). At the moment, I spend most of my time
?playing? with NetBSD, but I am getting tired of rebooting into Debian
just to perform certain tasks or simply to access some files.

I do not want to completely replace Debian, since some programs I rely
on do not exist on NetBSD at the moment (and that would complicate my
life too much). I also dislike the current trends in the Linux world,
which is what originally led me to explore the BSDs. Ideally, I would
like to maintain both operating systems with as little effort as possible.

The two internal SSDs are already full, and their partitions cannot be
modified. Therefore, I am considering using a WD Elements 2 TB USB drive
for this purpose. This drive would store all my useful data and would be
regularly backed up to other drives using rsync, as I already do. Both
operating systems will be able to read and write the files.

I initially thought about using an exFAT filesystem via FUSE, but as
soon as I started rsyncing data from Debian to it, I encountered errors
related to long and unusual characters in file names. Additionally,
exFAT lacks proper permission support.

Can I use an ext2 filesystem from NetBSD with confidence? Are there any
other good alternatives for this use case?


I've been using an ext2 partition as a shared commons between Debian and
NetBSD on an old 32 bit system for a few years now and it mostly works
fine, though as 32 bit systems get dropped I'm using it much less and
most of the shared files are plain text.  I seem to recall rsync backups
of the NetBSD system hanging on the Commons filesystem (see below) so I
only run rsync on Commons from the Debian side.  I haven't noticed the
timestamp issue mentioned in this thread but both Debian and NetBSD are
doing similar NTPD clock setting.

My setup (for commmon uid "jgw"):

--
# Debian:
$ uname -a
Linux slimline 6.1.0-42-686 #1 SMP PREEMPT_DYNAMIC Debian 6.1.159-1 (2025-12-30) i686 GNU/Linux

$ mount -t ext2,ext4
/dev/sda4 on /home/jgw/Commons type ext2 (rw,relatime)
/dev/sda1 on /boot type ext2 (rw,relatime)
/dev/sda2 on / type ext4 (rw,relatime,errors=remount-ro)

# NetBSD:
$ uname -a
NetBSD slimline 10.1_STABLE NetBSD 10.1_STABLE (GENERIC) #0: Fri Dec 26 12:53:23 UTC 2025 .../GENERIC i386

$ mount -t ffs,'puffs|p2k|ext2fs',umap
/dev/dk2 on / type ffs (log, noatime, local)
/dev/dk3 on /media/jgw type puffs|p2k|ext2fs
/media/jgw on /home/jgw/Commons type umap

$ egrep 'ffs|ext2fs|umap' /etc/fstab
NAME=NetBSD     /       ffs     rw,noatime,log          1 1
NAME=Commons    /media/jgw      ext2fs  rw,rump,auto
/media/jgw      /home/jgw/Commons       umap    rw,-g/GID_remap,-u/UID_remap,auto
--

The id(1) tool was used to populate the /GID_remap and /UID_remap files.
The disk is setup with gpt partitions with NetBSD booted via GRUB/

--
$ gpt show wd0
       start       size  index  contents
           0          1         PMBR
           1          1         Pri GPT header
           2         32         Pri GPT table
          34       2014         Unused
        2048       2048      6  GPT part - BIOS Boot
        4096    1046528      1  GPT part - EFI System
     1050624  268435456      2  GPT part - Linux data
   269486080  125829120      3  GPT part - EFI System
   395315200   83886080      4  GPT part - Linux data
   479201280    9195520      5  GPT part - NetBSD swap
   488396800        335         Unused
   488397135         32         Sec GPT table
   488397167          1         Sec GPT header
--

In above indicies 2-4 are Debian (ext4), NetBSD (ffs), Commons (ext2).
Interestingly, dkctl(8) shows the FFS partition as type "msdos":

--
$ sudo dkctl wd0 listwedges
/dev/rwd0: 6 wedges:
dk5: e8b85d79-899f-4cd6-964e-af3db098e992, 2048 blocks at 2048, type:
dk0: Boot, 1046528 blocks at 4096, type: msdos
dk1: Debian, 268435456 blocks at 1050624, type: ext2fs
dk2: NetBSD, 125829120 blocks at 269486080, type: msdos
dk3: Commons, 83886080 blocks at 395315200, type: ext2fs
dk4: Swap, 9195520 blocks at 479201280, type: swap
--

Weird eh?

Anyway, maybe this helps?  Would be interested to get feedback
if you opt for a similar setup.

Have fun,
beaker

Hi Beaker and Derrick,

Many thanks for the detailed information, it is very valuable for me to try ext2 approach.

Last two things. I see that in NetBSD ext2 filesystem can be used directly or in user space with FUSE. What do you recommend?

Second, if it matters, should I create ext2 filesystem from NetBSD with /sbin/newfs_ext2fs, with /usr/pkg/sbin/mkfs.ext2, or from Linux?

Thanks.








Home | Main Index | Thread Index | Old Index