zfsonlinux / pkg-zfs

Native ZFS packaging for Debian and Ubuntu
https://launchpad.net/~zfs-native/+archive/daily
308 stars 55 forks source link

Pool exported will not import again if "-d <device directory>" given #214

Open tps800 opened 7 years ago

tps800 commented 7 years ago

Wrong documentation or bug? Following instructions on https://github.com/zfsonlinux/pkg-zfs/wiki/HOWTO-install-EL7-(CentOS-RHEL)-to-a-Native-ZFS-Root-Filesystem

# zpool create -f -d -o feature@async_destroy=enabled -o feature@empty_bpobj=enabled -o feature@lz4_compress=enabled -o ashift=12 -O compression=lz4 rpool /dev/sdb2 I've used -f to force creation of a new pool overwriting the existing old one.

# zpool export rpool # zpool import -d /dev/disk/by-id rpool cannot import 'rpool': no such pool available

Something is wrong with these instructions. Afaik it should import the pool from found device in directory /dev/disk/by-id. But the exported pool cant be found. While

# zpool import rpool

will work.

Going on: # udevadm trigger # ls -la /dev/*part* ls: cannot access /dev/*part*: No such file or directory

Looks like this doesn't create the device as given.

The same goes for the raidz-Pool creation. Exporting doesn't work as creating the device with udevadm trigger.

tps800 commented 7 years ago

After all I was able to copy my filesystem to zfs, but trying to boot the whole thing: ol7zfs-2016-09-26-13-36-23

Wrong syntax for mounting zfs-volumes from kernel command line?

ethermcman commented 7 years ago

Short answer : you have to process the dracut command to the pool: dracut -f -v /rpool/ROOT/boot/initramfs-$(uname -r).img $(uname -r) Long answer : when you're on your temp system, when you process the dracut command as per instruction, you make this temp system to load the zfs module at boot but you're not making it to the zfs system. So when you're booting your zfs system, it doesn't know that it has to load the zfs module. This is why you have to run the dracut command against your pool. Sorry for my english : frenchie behind keyboard

ethermcman commented 7 years ago

For the zpool import -d /dev/disk/by-id rpool AND if you're on vmware workstation/player/vpshere, you have to add disk.EnableUUID = "TRUE" to your VM configuration file. Make sure to add it when your VM is shut down if not, VMWare will set it to "FALSE" or delete the entry at reboot.