Cnchi icon indicating copy to clipboard operation
Cnchi copied to clipboard

ZFS, NVME and partition naming bug

Open zeylos opened this issue 7 years ago • 5 comments

Hi,

Problem:

I'm struggling trying to get the zfs install to work on nvme disks, looks like Cnchi isn't getting the right partition label.

Here is my summary just before starting the partitioning image And here is the cnchi.log output after he successfully creates the zpool

2018-02-05 02:26:42 [DEBUG] zfs.py(1226) create_zfs(): Importing pool zroot (16858451377482952861)...
2018-02-05 02:26:42 [DEBUG] run_cmd.py(104) call(): 007f0100
2018-02-05 02:26:42 [DEBUG] install.py(177) mount_partitions(): ZFS: Mounting root
2018-02-05 02:26:42 [DEBUG] install.py(193) mount_partitions(): Mounting boot partition /dev/nvme0n12 into /install/boot directory
2018-02-05 02:26:42 [ERROR] run_cmd.py(119) call(): Error running ['mount', '/dev/nvme0n12', '/install/boot']: mount: /install/boot: special device /dev/nvme0n12 does not exist.
2018-02-05 02:26:42 [ERROR] process.py(130) run(): "Error running ['mount', '/dev/nvme0n12', '/install/boot']: mount: /install/boot: special device /dev/nvme0n12 does not exist."

Here is my partitions naming

# ls /dev |grep nvme
nvme0
nvme0n1
nvme0n1p1
nvme0n1p2
nvme0n1p3

Strange thing is it actually successfully create the pool before with the right partition name

2018-02-05 02:26:41 [DEBUG] zfs.py(1149) create_zfs(): Cnchi will create a ZFS pool using /dev/nvme0n1p3 devices
2018-02-05 02:26:41 [DEBUG] zfs.py(1053) create_zfs_pool(): Creating zfs pool zroot...
2018-02-05 02:26:41 [DEBUG] run_cmd.py(114) call(): Error running ['zpool', 'create', '-m', '/install', 'zroot', '/dev/nvme0n1p3']: invalid vdev specification
use '-f' to override the following errors:
/dev/nvme0n1p3 is part of potentially active pool 'zroot'
2018-02-05 02:26:41 [DEBUG] zfs.py(1073) create_zfs_pool(): Pool zroot created.
2018-02-05 02:26:41 [DEBUG] zfs.py(976) set_zfs_mountpoint(): cannot mount '/': directory is not empty
property may be set but unable to remount filesystem
2018-02-05 02:26:42 [DEBUG] zfs.py(852) get_pool_size(): zpool list -H -o size zroot
2018-02-05 02:26:42 [DEBUG] zfs.py(926) create_zfs_vol(): Creating a zfs vol zroot/swap of size 7GB
2018-02-05 02:26:42 [DEBUG] zfs.py(955) create_swap(): Formatting swap (/dev/zvol/zroot/swap)
2018-02-05 02:26:42 [DEBUG] run_cmd.py(104) call(): Setting up swapspace version 1, size = 7 GiB (7516188672 bytes)
no label, UUID=bed79c75-29be-45d3-9316-7b001081c287
2018-02-05 02:26:42 [DEBUG] zfs.py(1209) create_zfs(): Exporting pool zroot...
2018-02-05 02:26:42 [DEBUG] run_cmd.py(104) call():    pool: zroot
     id: 16858451377482952861
  state: ONLINE
 action: The pool can be imported using its name or numeric identifier.
 config:

	zroot        ONLINE
	  nvme0n1p3  ONLINE

Looks like a bug in the partition naming parsing function i guess ? By the way, thanks for all the good work :)

zeylos avatar Feb 05 '18 02:02 zeylos

Hi,

Yes, it's a bug for sure. None of the devs has nvme to test this on, thus we wrote it without the opportunity to test it as it should.

I'll try to have a look at this asap.

Thanks for reporting it!

karasu avatar Feb 05 '18 06:02 karasu

Hi!

A quick report on testing: after patching for #854, it installed mostly successfully, at least making it past the errors reported above.

On the first restart there was some trouble mounting, which resolved with a second restart, so I suspect there may still be some missing steps or similar trouble with the ZFS installation, a quick scan of the installation log showed a failed unmount that could be related:

bonwick on /install type zfs (rw,xattr,noacl)
/dev/nvme0n1p2 on /install/boot type ext4 (rw,relatime,data=ordered)
/dev/nvme0n1p1 on /install/boot/efi type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
2018-02-17 23:50:40 [DEBUG] auto_partition.py(73) unmount(): Unmounting /install/boot
2018-02-17 23:50:40 [DEBUG] auto_partition.py(73) unmount(): Unmounting /install/boot/efi
2018-02-17 23:50:40 [DEBUG] run_cmd.py(114) call(): Error running ['umount', '-l', '/install/boot/efi']: umount: /install/boot/efi: no mount point specified.
2018-02-17 23:50:40 [DEBUG] auto_partition.py(73) unmount(): Unmounting /install
2018-02-17 23:50:41 [INFO] slides.py(227) manage_events_from_cb_queue(): Installation finished

Here's the logs from my installation: https://gist.github.com/notmatt/3294d773fc3cf561e3e1bef27bef2fe2

notmatt avatar Feb 18 '18 02:02 notmatt

I was also hit by this, I tried running cnchi from the head of the 0.14.x branch which supposedly contained this patch but saw the same error (unless there is another step that I'm missing).

As far as testing goes, it appears the latest versions of VirtualBox can emulate NVMEs although I've not tried it.

t0mmyt avatar Feb 19 '18 11:02 t0mmyt

@t0mmyt could you provide the logs?

Are you referring to the original error or the not booting error that @notmatt described later? This last one has not been addressed.

Also, check that you're using the 0.14.420 version from the 0.14.x branch

karasu avatar Feb 19 '18 21:02 karasu

I was hit by the same bug as well. I am currently installing using the patched zfs.py.

I will check if i run into the same mount/unmount issues after the restart. Also if you need me to do some tests etc, i can probably help with that, since i have a seperate nvme drive that i could do some testing on.

skuffe avatar Mar 07 '18 17:03 skuffe