SOS: userdata lost

Sorry for the dumb question. While learning to manage Zpool, I tried to include my /home/vladas to the general pool as zroot/home/vladas, according to the existing example made by initial installation to HDD:

2021-08-28.18:25:48 zfs create -o canmount=off -o mountpoint=/usr zroot/usr
2021-08-28.18:25:49 zfs create zroot/usr/home

Unfortunately, all my user data from the home directory has been moved nowhere after

# zfs create -v -o compression=gzip -o canmount=off -o mountpoint=/home zroot/home
# zfs create -v zroot/home/vladas

No error warning issued, zpool history shows /home/vladas added to the pool zroot, yet home directory is empty, and also Openbox menu is not working now.

# zfs set canmount=on zroot/home did not help, # zfs unmount zroot/home responds by cannot unmount zroot/home: not currently mounted message.

I am learning ZFS handbook and manual further, although do not find an explanation yet.

Yesterday I could not neither save any data anywhere nor even log out from NomadBSD, so I had to turn off the computer with the power switch.

Luckily, logged in as a single user, I found all my files and was able to read user settings in their place at /home/vladas.

But I still can’t log in normally: I get that message every time I respond with a password of invited user vladas:

Failed to execute login command

Realizing that the system is locked to read-only, I rebooted as a single user to restore access according FreeBSD FAQ 10.5:

# mount -urv /

No effect. Apparently, because my filesystem is ZFS, not UFS. Its analog unlocked the system:

# zfs set readonly=off zroot

I then backed up my /home/vladas and verified chpass — no credentials has been changed since the day of NomadBSD installation last year.

I have no idea what to do next. ZFS terms in the handbook and manual are not clear to me, a non-techie desktop user. Wich one of create-destroy, attach-detach, import-export, mount-unmount, send-receive, online-offline means including and excluding my dataset to and from a pool?

root@:/# zfs unmount zroot/home/vladas
cannot unmount zroot/home/vladas: not currently mounted
root@:/# zfs unmount zroot/home
cannot unmount zroot/home: not currently mounted

Although zfs list claims zroot/home/vladas is still there in a pool.

# zfs destroy -nv zroot/home/vladas
would destroy zroot/home/vladas

Should I remove -n (no)? I am not sure it would not really destroy all my settings and assets. I am afraid, I will wait for tomorrow.

# zfs rollback zroot/ROOT/nomadbsd-5806f915@2022-02-24-09:27:30-0

reverted NomadBSD to the previous state, but /home was not included to the pool during installation, just an empty /usr/home. Thus the desktop remains locked, still Failed to execute login command.

Please share output from this command:

zfs get canmount,mountpoint | grep -e usr -e home

zroot/home canmount on local
zroot/home mountpoint /home local
zroot/home/vladas canmount on local
zroot/home/vladas mountpoint /home/vladas inherited from zroot/home
zroot/usr canmount off local
zroot/usr mountpoint /usr local
zroot/usr/home canmount on default
zroot/usr/home mountpoint /usr/home inherited from zroot/usr

Thank you for the reply, I am still stuck here.

echo $HOME

/root :flushed:

whoami

grep vladas /etc/passwd

(Hint: do not rush to attempt edition of the file.)

whoami — root (because I am logged in a single user mode)?

root@:/ # grep vladas /etc/passwd
vladas:*:1001:1001:Vladas Palubinskas:/home/vladas:/usr/local/bin/fish

Thanks, that makes sense.

ls -hln /home/vladas/.xinitrc

No such file or directory

1 Like

From https://forums.freebsd.org/posts/519529:

The package message mentioned a method of parsing the file, but did not express a requirement for the file to exist.

Sorry, I made mistake.

-rw-r--r-- 1 1001 1001 1478 Aug 28 2021 /home/vladas/.xinitrc
1 Like

cat /home/vladas/.xinitrc

(Re: your post 2, it seems reasonable to summarise that the user data is not lost; that we should focus on possible explanations for failure to execute a login command.)

I don’t know enough about NomadBSD to tell whether the rollback might have had a negative impact.

These zpool properties may also be informative:

root@:/ # zpool history
History for 'zroot':
2021-08-28.18:25:47 zpool create -o altroot=/tmp/nbsdinstaller.2241 -m none -f zroot /dev/gpt/nbsdrootfs
2021-08-28.18:25:47 zfs set compression=on zroot
2021-08-28.18:25:47 zfs set atime=off zroot
2021-08-28.18:25:48 zfs create -o mountpoint=none zroot/ROOT
2021-08-28.18:25:48 zfs create mountpoint=/ zroot/ROOT/nomadbsd-5806f915
2021-08-28.18:25:48 zfs create -o canmount=off -o mountpoint=/usr zroot/usr
2021-08-28.18:25:49 zfs create zroot/usr/home
2021-08-28.18:25:49 zfs create -o exec=off -o setuid=off zroot/usr/src
2021-08-28.18:25:49 zfs create zroot/usr/obj
...
2021-08-28.18:25:57 zpool set bootfs=zroot/ROOT/nomadbsd-5806f915 zroot
2022-02-27.18:41:55 zfs create -v -o compression=gzip -o canmount=off -o mountpoint=/home zroot/home
2022-02-27.18:58:48 zfs create -v zroot/home/vladas

My system here was locked from vladas and became read-only for admin.

Then I attempted to fix my pool — the history goes on:

2022-02-27.19:09:57 zfs set canmount=on zroot/home/vladas
2022-02-27.20:04:20 zfs set canmount=on zroot/home
2022-02-27.21:20:05 zfs set compression=off zroot/home

AFAIK, the rollback cannot damage, it just brings back the former state — always valid. We can just lose the latest data.

1 Like
root@:/ # cat /home/ vladas/.xinitrc
#!/bin/sh
export EDITOR=ee
. ~/.xprofile

[ -z "$1" -o '$1" = "default" ] && exec ck-launch-session openbox-session exec ck-launch-session "$1"
1 Like

Probably not relevant, but I’m curious:

If you unmount those two, then does there remain a symbolic link?

Here (with FreeBSD, and users added by adduser(8)):

% file /home
/home: symbolic link to usr/home
% 

As far as I can remember, /home and /home/vladas were real assets from the begining, and /usr/home was always empty, with no links. Anyway, the system was locked before the mounting attempt — immediately after zfs create -v zroot/home/vladas.

root@:/ # file /home
/home: directory