# FreeBSD Unix & SlackwareGNU/Linux shared ZFS /home & swap?



## dchmelik (May 24, 2020)

Originally I tried asking this on news://comp.unix.bsd.misc , news://list.freebsd.questions , news://list.freebsd-questions , news://mailing.freebsd.questions , news://alt.os.linux.slackware (hey, why can't you use pre-WWW URIs here?!) but it seems freebsd-questions no longer connects to Usenet?

I dual-boot FreeBSD Unix & Slackware GNU/Linux (on solid state drive, SSD) and would like to share ZFS /home (separate hard disc drive, HDD,) and, on secondary/laptop PC, same except one drive w/shared ZFS swap & /home.  I only need a safely-writable journalling fileystem, so wish it was as simple as newfs/mkfs.

I did once in '10s but was extremely difficult (almost like an operating system, OS its own) and forgot everything.  Well, I know I need to dump list of option sets ZFS packages support, then can only use options in set intersection... when I did that, despite using same options (I tried on FreeBSD first) it _only_ worked to make it on Slackware first then add in FreeBSD: not vice-versa.

People in main Slackware forums (Usenet, LinuxQuestions.org) just change topic or say read OpenZFS documentation (only documents newer, non-Unix-like GNU/Linux) which is a different package than ZFSOnLinux.  I have no idea there may be differences or how to do this.

A Slackware site does have tutorial/HOWTO to use QEMU emulator/virtual-machine (emu/VM) to run Slackware and setup ZFS /: much more complicated than I want.

Of course, I probably should hear advice what options to use (no compression, nor snapshots) but wish there were simpler tutorials/HOWTOs, just for /home, and in case of dual-boot, and other text for swap,

FreeBSD was first other OS I used, in college (freshman,) then Slackware/etc. desktops that year (too difficult a while) but NetBSD in early-to-mid '00s (while trying to transition from DOS/Win9x)... soon because NetBSD missed drivers, I switched back to Slackware, but I no longer use that hardware.  Of course, I installed/tried all classic *BSD (and some other GNU/Linux) over years (variously for PC or server) but now have come to firstly like FreeBSD.  However, after 15+ years of Slackware usage, I maintain 10+ unoffical packages, and may not want to stop.  I do, however, want to transition back to FreeBSD.

While I wish any/all *BSDs would create some .ISOs as large as Slackware--so 'make' would almost never halt then you install development dependencies/tools/languages (they're mostly all there)--having to maybe often install those would be small price to pay for cleaner/stable kernel even that was largely planned ahead of time (not GNU/Linux 'make up as you go along') and similarly-designed 'userland' code.

I don't know why some years ago FreeBSD added XFS then removed (really to attract Linux users/programmers?  I was a *BSD user/programmer first and regularly, but now a few GNU/Linux have a few other things.)  As for Linux kernel, they keep/add support for devices/systems almost no one uses (like building the kernel, everyone sees option for Google employees only, for secret company-built servers) but even since 1990s, they don't have safe UFS writing support.  If only that or EXT4 had safe writing support on the other, I wouldn't need to struggle through ZFS... but basically, that's all there is, right?  (NTFS isn't safe option.)

I hope some people did something such as that and could document.  If NetBSD or OpenBSD use same and it'd work the same, that'd be fine... I know FreeBSD in future will switch to ZFSOnLinux... but FreeBSD 13-CURRENT has OpenZFS so guess that's required.

Of course, these days, people shouldn't often have to dual-boot just to program, because of virtualization.  I've heard it's possible to run a GNU/Linux jail?  I also heard 'Xen is second-class on FreeBSD' but Xen sounds nicer in the sense (as Qubes does) you can open programs from a Xen guest OS X session as if part of host OS X session, without having to select in & out of inset emu/VM window (without Qubes you might have to be an advanced Xen hacker to setup.)  So in the future I'd like Slackware as a guest OS... even then, ZFS /home might still be only option.

I vaguely recall, it's not really that hard: you install ZFS/dependencies, dump option lists, choose options, create some sort of weird ZFS 'partition,' create one or more filesystems in that (in my first case, only one,) do more than usual to mount & unmount, add partition/filesystem(s) in other OS, mount, copy in user data from backups, unmount, recheck other OS.  Sounds like only 15 steps (considering two installations & option list dumps) but when you forgot most, sounds extremely difficult.

In fact, last time, it took days/weeks/months research, and days setup, but things changed, so it might again.  Last time I got help on Internet Relay Chat (IRC) and probably should've documented what I did (but things changed.)  These years I avoid IRC science/engineering/programming/technology channels because I think that IRC might've gotten worse (and I spend more time on other IRC.)

I know (from experience) the two OSes might write different configurations, but I really/truly don't care: I recall shells were fine, since I use several... even if using the same, usually similar/same version; not a big deal... if not, just use different.   People who didn't grow up before graphical user interfaces (GUIs) were OSes will say that will probably mess up your GUI.  So what?  GUI is just an optional program; use a simpler one than window manager (WM) or desktop environment (DE) of complicated files.  Eventually one would mainly use one OS, maybe for nicer X WM/DE, and only minimalist X on other.   However, really, I don't program X stuff for Slackware; only command-line (well, I program mathics.SlackBuild, which can be command-line or in a web browser, so that's okay I guess, and I program Dungeon Crawl stone_soup.SlackBuild, which recently can run in X, but doesn't need WM or DE, nor do similar roguelike games recently for X, which is optional anyway... someone else could take over if necessary.)

So I'm going to have to transition back to FreeBSD on main desktop (not just some servers) but want to slowly... because originally I mainly used it as a lab user/programmer (though we did learn to install) not system administrator (sysadmin) so need to be able to use something else if I make a critical mistake when still learning things (even if some program works on both, but I'm learning setup on *BSD.)


----------



## Menelkir (May 25, 2020)

dchmelik said:


> I don't know why some years ago FreeBSD added XFS then removed


sysutils/fusefs-lkl will mount not only xfs but most linux files systems R/W with some minor issues (sometimes gives me some lag, copying a large number of files using misc/mc makes the directory pane appears empty and you need to refresh a couple of times, etc).

About the swap, as far as I know, you can make a regular swap partition to use with freebsd (since freebsd doesn't care much about the format the swap partition) and make linux format the swap (it's fast) on every boot and then swapon the partition (linux need a partition with the swap "kind" to work).


----------



## zirias@ (May 25, 2020)

dchmelik said:


> but it seems freebsd-questions no longer connects to Usenet?


As far as I know, any usenet hierarchies delivering FreeBSD mailing list content were always "read only". To participate, use the mailing lists directly:
https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/eresources-mail.html


----------



## dchmelik (Jun 5, 2020)

I got ZFS working now.  Since this was a question about FreeBSD-current, I guess it can be deleted, though I plan to try this on 12.1 next... unless XFS is better?

If XFS is simpler to use (not like an OS in itself, like ZFS almost is) I might want to switch to it.  However it sounds ZFS may just be a bit more complete/'polished' now than XFS? (I didn't usually get lag this time or last time... last time, mid-'10s. I recall once something took a long time, maybe mounting or unmounting, but ZFS IRC people just said do some command to make the particular ZFS more updated to speed up...)


----------



## rootbert (Jun 5, 2020)

XFS and ZFS are completely different filesystems with a completely different goal. If you want to use FreeBSD use ZFS. If you want virtualization in FreeBSD use virtualbox or bhyve, you can build your own system like qubes not only with bhyve/virtualbox but you can use the faster jail implementation. Do not try to run a Linux jail unless you want to tinker around, go with a full virtualization of your favourite linux distro.


----------

