A: Where did you get that list of block devices from? Why do some have a % at the end?
When typing `mount /dev/` and typing the tab key to obtain filenames suggestions, this is what appears:
Code:
acpi% atkbd0% cuau0% devstat% hpet0% log@ mdctl% pci% stdout@ ttyv0% ttyv8% ugen3.1@ zfs%
ada0% audit% cuau0.init% diskid/ io% lpt0% mem% ppi0% sysmouse% ttyv1% ttyv9% ugen4.1@
ada0p1% auditpipe% cuau0.lock% fd/ kbd0@ lpt0.ctl% midistat% pts/ ttyu0% ttyv2% ttyva% ugen4.2@
ada0p2% bpf% cuau1% fido% kbd1@ md0% msdosfs/ random% ttyu0.init% ttyv3% ttyvb% urandom@
ada0p3% bpf0@ cuau1.init% full% kbdmux0% md1% netmap% reroot/ ttyu0.lock% ttyv4% ufssuspend% usb/
ada0p4% console% cuau1.lock% geom.ctl% klog% md2% nfslock% sndstat% ttyu1% ttyv5% ugen0.1@ usbctl%
apm% consolectl% devctl% gpt/ kmem% md3% null% stderr@ ttyu1.init% ttyv6% ugen1.1@ xpt0%
apmctl% ctty% devctl2% gptid/ led/ md4% pass0% stdin@ ttyu1.lock% ttyv7% ugen2.1@ zero%
What do you mean by "not the real names"?
Well, I thought something must have been wrong with these names /dev/ada0, /dev/ada0p1 etc..., because when I run
# mount -t zfs /dev/ada0 /actually/existing/directory/
I get:
Code:
mount: /dev/ada0: No such file or directory
and running
# mount -t zfs /dev/ada0p1 /actually/existing/directory/
leads to
Code:
mount: /dev/ada0p1: No such file or directory
This is pretty disconcerting and led me to think maybe the /dev/ada0 is not the "real name" of the file, maybe I must add the % at the end.
But actually I get the same result when adding the %.
I now think the % is just presentation/display when using the tab key. I'm still clueless about why `mount` thinks there's no such file as /dev/ada0p1, while actually there is.
B: Which one of those partitions is your ZFS partition? My hunch is going to be ada0p4 (just guess from the Linux numbering system sda4 -> ada0p4). Verify that with gpart
. This would be a really good time to read "man gpart".
Well, I don't know why I talked about zfs partitions. It's an entire hard drive that I'm trying to access. The OVH installer installed FreeBSD on this drive. This hard drive has 4 partitions (boot, root, swap and home). I know this server uses ZFS. When I installed the server at OVH, you had the choice between ZFS or something else and I chose ZFS. I probably shouldn't have chosen ZFS since I didn't know anything about it at the time. I thought I'd have some time to learn about ZFS but I never found the time to read about ZFS until today.
# gpart show /dev/ada0p4
Code:
gpart: No such geom: /dev/ada0p4.
# gpart show /dev/ada0
Code:
=> 40 976773088 ada0 GPT (466G)
40 1600 1 efi (800K)
1640 1024 2 freebsd-boot (512K)
2664 1432 - free - (716K)
4096 8388608 3 freebsd-swap (4.0G)
8392704 968380416 4 freebsd-zfs (462G)
976773120 8 - free - (4.0K)
C: Did you or did you not export the ZFS pool when running it on Linux? Have you verified whether Linux and FreeBSD ZFS pools and file systems are compatible?
Nothing worked on linux. I'm now using a FreeBSD rescue system.
D: If you get past these questions, then zpool import
should work, followed by zfs mount
. I would propose that you first read the man pages for the zfs and zpool commands (they are long, but full of very useful information that explains concepts, and well written).
I read about zfs now, espcially the pages in the FreeBSD manual. This doesn't help as it's entirely about how to create pools, datasets etc... Nothing about how to read the content of a hard drive that uses zfs and probably has all these things already created.
Using this link advice:
https://unix.stackexchange.com/ques...thout-clobbering-altering-current-or-ext?rq=1
I ran:
# zpool import -o readonly=on -d /dev -f -R ~/mydir 10543172897146326321
(trying with the readonly option seemed a good idea to avoid destroying anything at first)
This led to partial result. ~/mydir got populated with:
1) a home directory corresponding to the old home directory of the server I'm trying to repair
2) a zroot directory which is empty
This gave me hope but this was not what I wanted to obtain since I want to access my old /etc/ directory to modify the
pf.conf file.
So I'm stuck now.
Any help appreciated.