Reusing disks from Xen for TrueNAS Scale

I am adding a couple 1TB drives that were previously used with XCP-NG/Xen to some new (to me) drives for another pool on my TrueNAS Scale server. The new drives show up in the TrueNAS gui but the reused drives do not. If I drop to the shell and do an lsblk I can see the two reused drives that were part of an LVM in XCP-NG previously. How do I break that so I can add them to my new pool?

From the command line you can use cfdisk and delete the partitions on those. Also paste the output of a command instead of a screenshot as it would be mush easier to read.

Thank you for your response Tom- Unfortunately, I’m still struggling with this. I was not able to find a way to delete the partitions with cfdisk or fdisk so I moved the drives over to another server. Once moved over, I used gparted to wipe and set a new clean partition on them. Now I only see the /dev/zd0 in TrueNAS but I can’t find a way to remove it. cfdisk sees it as 2TB of free space but does not give me an option to delete it. The TrueNAS server was rebooted to ensure it was reading all the disks.

Output from fdisk -l:
Disk /dev/zd0: 2 TiB, 2199023288320 bytes, 4294967360 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 32768 bytes
I/O size (minimum/optimal): 32768 bytes / 32768 bytes
Disklabel type: dos
Disk identifier: 0xde374cc2

Output from lsblk -l
root@NAS2[~]# lsblk -l
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 838.4G 0 disk
sda1 8:1 0 2G 0 part
sda2 8:2 0 836.4G 0 part
sdb 8:16 0 838.4G 0 disk
sdb1 8:17 0 2G 0 part
sdb2 8:18 0 836.4G 0 part
sdc 8:32 0 838.4G 0 disk
sdc1 8:33 0 2G 0 part
sdc2 8:34 0 836.4G 0 part
sdd 8:48 0 838.4G 0 disk
sdd1 8:49 0 2G 0 part
sdd2 8:50 0 836.4G 0 part
sde 8:64 0 838.4G 0 disk
sde1 8:65 0 2G 0 part
sde2 8:66 0 836.4G 0 part
sdf 8:80 0 838.4G 0 disk
sdf1 8:81 0 2G 0 part
sdf2 8:82 0 836.4G 0 part
sdg 8:96 0 838.4G 0 disk
sdg1 8:97 0 2G 0 part
sdg2 8:98 0 836.4G 0 part
sdh 8:112 0 838.4G 0 disk
sdh1 8:113 0 2G 0 part
sdh2 8:114 0 836.4G 0 part
sdi 8:128 0 838.4G 0 disk
sdi1 8:129 0 2G 0 part
sdi2 8:130 0 836.4G 0 part
sdj 8:144 0 838.4G 0 disk
sdj1 8:145 0 2G 0 part
sdj2 8:146 0 836.4G 0 part
sdk 8:160 0 838.4G 0 disk
sdk1 8:161 0 2G 0 part
sdk2 8:162 0 836.4G 0 part
sdl 8:176 0 838.4G 0 disk
sdl1 8:177 0 2G 0 part
sdl2 8:178 0 836.4G 0 part
sdm 8:192 0 838.4G 0 disk
sdm1 8:193 0 2G 0 part
sdm2 8:194 0 836.4G 0 part
sdn 8:208 0 838.4G 0 disk
sdn1 8:209 0 2G 0 part
sdn2 8:210 0 836.4G 0 part
sdo 8:224 0 931.5G 0 disk
sdp 8:240 0 931.5G 0 disk
md123 9:123 0 2G 0 raid1
md124 9:124 0 2G 0 raid1
md125 9:125 0 2G 0 raid1
md126 9:126 0 2G 0 raid1
md127 9:127 0 16G 0 raid1
sdq 65:0 0 931.5G 0 disk
sdr 65:16 0 931.5G 0 disk
sds 65:32 0 931.5G 0 disk
sdt 65:48 0 931.5G 0 disk
sdu 65:64 0 279.4G 0 disk
sdu1 65:65 0 1M 0 part
sdu2 65:66 0 512M 0 part
sdu3 65:67 0 262.9G 0 part
sdu4 65:68 0 16G 0 part
sdv 65:80 0 279.4G 0 disk
sdv1 65:81 0 1M 0 part
sdv2 65:82 0 512M 0 part
sdv3 65:83 0 262.9G 0 part
sdv4 65:84 0 16G 0 part
zd0 230:0 0 2T 0 disk
md127 253:0 0 16G 0 crypt [SWAP]
md123 253:1 0 2G 0 crypt [SWAP]
md126 253:2 0 2G 0 crypt [SWAP]
md124 253:3 0 2G 0 crypt [SWAP]
md125 253:4 0 2G 0 crypt [SWAP]

The shred command is available in TrueNAS Scale, you could try that.

Resolved- I ended up having to go into the HBA controller and wipe then mark the drives as “non-raid”. After performing these tasks, the drives show up now in TrueNAS to be assigned to a pool.

I’m guessing wiping them in the controller had no effect, but it was the marking them as non-raid that made them visible.

I just pulled drives out of a different brand of NAS server that failed for reuse in a TN Scale server. The used drives won’t show up as the underlying software thinks they are part of a Raid array and also have partition info on them. The TrueNAS Quick Wipe does nothing that I could ever tell even though is said successful; it certainly will not prepare used drives from another system for reuse and the other two options (write zeros and write random) would take forever.

I would try the following:

From the Truenas command line do a lsblk to list the drives so you can get their /dev/sd designation and then do a sudo wipefs --all on each drive. This will wipe out the previous raid info and any partition info from the drives making them able to be reused in TrueNAS. I did 32 drives recently (6, 8, 10TB) one at a time as it only takes a few seconds to run the command on each drive and there was no chance of me accidentally wiping the wrong drives.

Edit: If you do another lsblk after you do a wipefs on a drive you will see the drive now has no partitions or md info on it. It can now be reused.

1 Like