liveCD zfs mount reddit / freebsd ---------------------------------------------------------------------- cmic37 · 2020-11-02 11:25 On a working PC (zoulou) FreeBSD 12.2 , I have the following: `zoulou/cmic>zfs mount` `zroot/ROOT/default /` `zroot/var/mail /var/mail` `zroot/usr/home /usr/home` `zroot/var/log /var/log` `zroot/usr/src /usr/src` `zroot/usr/ports /usr/ports` `zroot /zroot` `zroot/var/audit /var/audit` `zroot/tmp /tmp` `zroot/var/crash /var/crash` `zroot/var/tmp /var/tmp` I shutdown and boot on a usb FreeBSD install and select LiveCD. At the liveCD prompt, how to zfs mount for exemple /usr/home to read/restore a file on my home dir (which is on ada0p3 for the matter) ? I tried: `zfs mount zroot/usr/home` to no avail TYA ---------------------------------------------------------------------- FUZxxl · 2020-11-02 11:57 Try e.g. zpool import -R /zroot zroot This imports the zpool `zroot` and mounts its file systems under `/zroot`. It is unwise to leave out `-R /zroot` in this situation. ---------------------------------------------------------------------- cmic37 · 2020-11-02 16:53 Thank you for the reply. I tried this, but the error message says that /usr/home is not accessible because this is a liveCD, and "/" is mounted read-only. My goal is to "mount" /usr/home in case my PC can't boot on the HD, and to read my /home files. How should I process ? (I not very very skillfull whith ZFS, Zpool, ... though) ---------------------------------------------------------------------- FUZxxl · 2020-11-02 17:10 After you have performed the command I showed you, `zroot/usr/home` is mounted to `/zroot/usr/home`. The prefix `/zroot` applies to all file systems in the pool. It is the prefix I have configured with `-R /zroot`. Do not leave this out as you will otherwise mount the file systems in the pool over those from the live CD which can lead to problems. ---------------------------------------------------------------------- cmic37 · 2020-11-03 14:59 I booted from a usb memory key -> FreeBSDinstaller->LiveCD, then: `#zpool import -R /zroot zroot` `ZFSnotice Prefetch is disabled ..` `ZFS filesystem version: 5` `ZFS storage pool version: feature support (5000)` `cannot import 'zroot' pool may be in use from other system, it was last accessed by zoulou (hostid: 0x11c2f26e) on Tue Now 3 16:09:57 2020` `use -f to import anyway` This is what I do (option -f) `#zpool import -f -R /zroot zroot` `cannot mount '/zoot/usr/ports' mount failed` `cannot mount 'zroot/usr/home': failed to create mountpoint` `cannot mount ':zroot/var/log': failed to create mountpoint` `cannot ...`. Question 1: on the first try, the error reads "... may be in use from another system". I thought /zoot had been exported before shutdown of zoulou ?? What did I miss ? Question2: whith option -f (force) it appears that the command cannot create anything: of course, the / partition is mounted readonly. So how could I read back my files on /usr/home/cmic? Maybe LicveCD is not the rigth way to do that ?? Thnk you for your help. ---------------------------------------------------------------------- FUZxxl · 2020-11-03 15:09 > Question 1: on the first try, the error reads "... may be in use from another system". I thought /zoot had been exported before shutdown of zoulou ?? What did I miss ? A shutdown does not export a zpool. > Question2: whith option -f (force) it appears that the command cannot create anything: of course, the / partition is mounted readonly. So how could I read back my files on /usr/home/cmic? Maybe LicveCD is not the rigth way to do that ?? Can you give me the output of `mount` on the live system? There's probably a tmpfs mounted somewhere. We can mount the zpool under that. E.g. suppose `/tmp` is a tmpfs, it might work to do zpool import -f -R /tmp/zroot zroot Alternatively, you may try zpool import -f -R /mnt zroot as `/mnt` is generally available as a mount point. ---------------------------------------------------------------------- cmic37 · 2020-11-03 22:21 Here it is: `zoulou/usr/home/cmic >mount` `zroot/ROOT/default on / (zfs, local, noatime, nfsv4acls)` `devfs on /dev (devfs, local, multilabel)` `zroot/usr/home on /usr/home (zfs, local, noatime, nfsv4acls)` `zroot/usr/src on /usr/src (zfs, local, noatime, nfsv4acls)` `zroot/tmp on /tmp (zfs, local, noatime, nosuid, nfsv4acls)` `zroot/var/log on /var/log (zfs, local, noatime, noexec, nosuid, nfsv4acls)` `zroot/usr/ports on /usr/ports (zfs, local, noatime, nosuid, nfsv4acls)` `zroot on /zroot (zfs, local, noatime, nfsv4acls)` `zroot/var/audit on /var/audit (zfs, local, noatime, noexec, nosuid, nfsv4acls)` `zroot/var/crash on /var/crash (zfs, local, noatime, noexec, nosuid, nfsv4acls)` `zroot/var/mail on /var/mail (zfs, local, nfsv4acls)` `zroot/var/tmp on /var/tmp (zfs, local, noatime, nosuid, nfsv4acls)` I'll try to import to /tmp/zroot and to /mnt. ---------------------------------------------------------------------- FUZxxl · 2020-11-03 22:28 Is that the output on the live disc? ---------------------------------------------------------------------- cmic37 · 2020-11-04 10:26 yep. The output of my OS on /dev/ada0 `root@zoulou:/home/cmic # zpool status` `pool: zroot` `state: ONLINE` `scan: none requested` `config:` `NAME STATE READ WRITE CKSUM` `zroot ONLINE 0 0 0` `ada0p3 ONLINE 0 0 0` `errors: No known data errors` ---------------------------------------------------------------------- TorMazila · 2020-11-04 14:23 Just use some other existing directory instead of /zroot. like /mnt or whatever. After you import zpool, you can manually mount whatever was unable to mount wherever you want. mdconfig&MFS are your good friends for creation of temporary writable storage. ---------------------------------------------------------------------- cmic37 · 2020-11-04 18:06 SOLVED. I booted from a usb memory key -> FreeBSDinstaller->LiveCD, then: NB: /tmp is the only directory which is \*not\* read only. `login: root#zpool import -f -R /tmp/zroot zroot` I inserted another USB memory key to backup some files from /usr/home/cmic`#mount /dev/da1s1 /tmp/myRestore#cd /tmp/zroot/usr/home/cmic#cp journal.zoulou anotherFile.txt /tmp/myRestore` I can even write on /tmp/zroot/home/cmic/ directory: `#echo "some texte here" > /tmp/zroot/usr/home/cmic#umount /tmp/myRestore#reboot` Don't forget to remove the USB memeory keys, before restarting the OS. Thank you [FUZxxl](https://www.reddit.com/user/FUZxxl/) for your help. ---------------------------------------------------------------------- FUZxxl · 2020-11-04 18:10 Cool!