nomadbsd / NomadBSD

Livesystem based on FreeBSD
http://nomadbsd.org
BSD 2-Clause "Simplified" License
340 stars 41 forks source link

Mismatched replication level: pool uses disk and new vdev is file #133

Open Marietto2008 opened 1 year ago

Marietto2008 commented 1 year ago

Hello.

I've downloaded the new version of NomadBSD and I have increased its size with this command :

# truncate -s +280g nomadbsd-131R-20221130.amd64.zfs

at this point I've dd'ed the image to one of my disks with the following command :

# dd if=nomadbsd-131R-20221130.amd64.zfs of=/dev/da1

unfortunately,when the operation ended,I realized that the nomadbsd image file didn't increase its space at all,I don't know why :

# gpart show

=>       63  625142385  da1  MBR  (298G)
         63       1985       - free -  (993K)
       2048      81920    1  efi  (40M)
      83968    7022592    2  freebsd  [active]  (3.3G)
    7106560  618035888       - free -  (295G)

# zfs list

NAME                                           USED  AVAIL     REFER  MOUNTPOINT

nomadbsd-zroot                                2.37G   772M       96K  /mnt/nomadbsd-zroot/nomadbsd-z
root
nomadbsd-zroot/ROOT                           2.37G   772M       96K  none
nomadbsd-zroot/ROOT/default                   2.37G   772M     2.37G  /mnt/nomadbsd-zroot
nomadbsd-zroot/usr                             584K   772M       96K  /mnt/nomadbsd-zroot/usr
nomadbsd-zroot/usr/obj                          96K   772M       96K  /mnt/nomadbsd-zroot/usr/obj
nomadbsd-zroot/usr/ports                       296K   772M      104K  /mnt/nomadbsd-zroot/usr/ports
nomadbsd-zroot/usr/ports/distfiles              96K   772M       96K  /mnt/nomadbsd-zroot/usr/ports/
distfiles
nomadbsd-zroot/usr/ports/packages               96K   772M       96K  /mnt/nomadbsd-zroot/usr/ports/
packages
nomadbsd-zroot/usr/src                          96K   772M       96K  /mnt/nomadbsd-zroot/usr/src
nomadbsd-zroot/var                             424K   772M       96K  /mnt/nomadbsd-zroot/var
nomadbsd-zroot/var/audit                       104K   772M      104K  /mnt/nomadbsd-zroot/var/audit
nomadbsd-zroot/var/crash                        96K   772M       96K  /mnt/nomadbsd-zroot/var/crash
nomadbsd-zroot/var/mail                        128K   772M      128K  /mnt/nomadbsd-

# zfs list -t all -o space -r nomadbsd-zroot

NAME                                AVAIL   USED  USEDSNAP  USEDDS  USEDREFRESERV USEDCHILD

nomadbsd-zroot                       772M  2.37G        0B     96K             0B      2.37G
nomadbsd-zroot/ROOT                  772M  2.37G        0B     96K             0B      2.37G
nomadbsd-zroot/ROOT/default          772M  2.37G        0B   2.37G             0B         0B
nomadbsd-zroot/usr                   772M   584K        0B     96K             0B       488K
nomadbsd-zroot/usr/obj               772M    96K        0B     96K             0B         0B
nomadbsd-zroot/usr/ports             772M   296K        0B    104K             0B       192K
nomadbsd-zroot/usr/ports/distfiles   772M    96K        0B     96K             0B         0B
nomadbsd-zroot/usr/ports/packages    772M    96K        0B     96K             0B         0B
nomadbsd-zroot/usr/src               772M    96K        0B     96K             0B         0B
nomadbsd-zroot/var                   772M   424K        0B     96K             0B       328K
nomadbsd-zroot/var/audit             772M   104K        0B    104K             0B         0B
nomadbsd-zroot/var/crash             772M    96K        0B     96K             0B         0B
nomadbsd-zroot/var/mail              772M   128K        0B    128K             0B         0B

# zpool list nomadbsd-zroot

NAME             SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT

nomadbsd-zroot  3.25G  2.37G   900M        -         -    53%    72%  1.00x    ONLINE  /mnt/nomadbsd-zroot

# zfs get refquota,quota,refreservation,reservation nomadbsd-zroot

NAME            PROPERTY        VALUE      SOURCE

nomadbsd-zroot  refquota        none       default
nomadbsd-zroot  quota           none       default
nomadbsd-zroot  refreservation  none       default
nomadbsd-zroot  reservation     none       default

as you can see there is 295G of free space on the disk. Actually I'm trying to resize the space occupied by the nomadbsd-zroot pool. This is what I tried to do :

# truncate -s 280G /zroot2/extend_nomadbsd-zrootx
# zpool add nomadbsd-zroot /zroot2/extend_nomadbsd-zrootx

BUT I get this error :

invalid vdev specification use '-f' to override the following errors: mismatched replication level: pool uses disk and new vdev is file

what to do now ? thanks.

mrclksr commented 1 year ago

Hi @Marietto2008,

if you write the image to a physical disk, there is no need to truncate. NomadBSD will use all the remaining space of the device, no matter how big the image is. truncate makes only sense if you create a virtual disk.

I don't see the /home dataset, so I assume you didn't boot the disk and run the setup. NomadBSD can't expand the filesystem if you don't run it ;-)