Can't attach boot device because it is smaller (but bigger than pool)

asimov-solensan

Contributor
Joined
Oct 14, 2016
Messages
113
Hello,

My problem is that the system won't allow me to attach a 80GB disk to the boot pool because the actual disk is 120GB.

But the pool itself is only 59GB. The 80Gb disk would be enough to mirror it, is there a way to solve this?

1575705081926.png


Not a big deal but I was checking disks and I have got a couple of old ones that I want to reuse until they die instead of just wasting them.
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,079
If you want to make a mirror for your boot pool, both drives need to be the same size, regardless of the size of what zpool list is telling you.
For example:
Code:
root@Emily-NAS:~ # zpool list
NAME           SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP  HEALTH  ALTROOT
Backup        43.5T  16.8T  26.7T        -         -     6%    38%  1.00x  ONLINE  /mnt
Emily         43.5T  19.1T  24.4T        -         -     0%    43%  1.00x  ONLINE  /mnt
Irene         43.5T  18.3T  25.2T        -         -     0%    42%  1.00x  ONLINE  /mnt
freenas-boot  37.2G  14.9G  22.4G        -         -      -    39%  1.00x  ONLINE  -
root@Emily-NAS:~ #

If you look at the zpool status instead:
Code:
root@Emily-NAS:~ # zpool status freenas-boot
  pool: freenas-boot
 state: ONLINE
  scan: scrub repaired 0 in 0 days 00:13:50 with 0 errors on Sat Nov 23 03:58:52 2019
config:

        NAME                                            STATE     READ WRITE CKSUM
        freenas-boot                                    ONLINE       0     0     0
          mirror-0                                      ONLINE       0     0     0
            gptid/f659fd6d-4b12-11e6-a97c-002590aecc79  ONLINE       0     0     0
            gptid/f6a61d33-4b12-11e6-a97c-002590aecc79  ONLINE       0     0     0

errors: No known data errors
root@Emily-NAS:~ #

You will see the list of partitions that make up the pool. You can add a second partition to a single disk, but the second partition must be equal or larger than the first.
If you use the command glabel list, you can see the size of all the partitions in your system, like this:
Code:
Geom name: ada0p1
Providers:
1. Name: gptid/f69330dd-4b12-11e6-a97c-002590aecc79
   Mediasize: 524288 (512K)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 17408
   Mode: r0w0e0
   secoffset: 0
   offset: 0
   seclength: 1024
   length: 524288
   index: 0
Consumers:
1. Name: ada0p1
   Mediasize: 524288 (512K)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 17408
   Mode: r0w0e0

Geom name: ada0p2
Providers:
1. Name: gptid/f6a61d33-4b12-11e6-a97c-002590aecc79
   Mediasize: 40007196672 (37G)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 544768
   Mode: r1w1e1
   secoffset: 0
   offset: 0
   seclength: 78139056
   length: 40007196672
   index: 0
Consumers:
1. Name: ada0p2
   Mediasize: 40007196672 (37G)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 544768
   Mode: r1w1e2

Geom name: ada1p1
Providers:
1. Name: gptid/f648c607-4b12-11e6-a97c-002590aecc79
   Mediasize: 524288 (512K)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 17408
   Mode: r0w0e0
   secoffset: 0
   offset: 0
   seclength: 1024
   length: 524288
   index: 0
Consumers:
1. Name: ada1p1
   Mediasize: 524288 (512K)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 17408
   Mode: r0w0e0

Geom name: ada1p2
Providers:
1. Name: gptid/f659fd6d-4b12-11e6-a97c-002590aecc79
   Mediasize: 40007196672 (37G)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 544768
   Mode: r1w1e1
   secoffset: 0
   offset: 0
   seclength: 78139056
   length: 40007196672
   index: 0
Consumers:
1. Name: ada1p2
   Mediasize: 40007196672 (37G)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 544768
   Mode: r1w1e2

I trimmed the output to only show the drives participating in my boot pool, I have 34 drives, so I didn't want too much to look at...
Still, you can see that the datasize of the partitions being used (ada0p2 and ada1p2) are both 37G.
If you use the GUI, it will partition the drive for you, but there needs to be enough free space on the new drive to hold a partition that is as large as the existing partitions on the original boot drive.

You could backup your config.db, do a fresh installation on the 80GB drive, restore the config.db and then use the 120GB drive to mirror the 80GB drive, but you can't use an 80GB drive to mirror the 120GB drive.
 
Top