vermaden / lsblk

List information about block devices in the FreeBSD system.
BSD 2-Clause "Simplified" License
25 stars 2 forks source link

Wrong fstype detected for ZFS RAID-Z1 #4

Open lcheylus opened 2 years ago

lcheylus commented 2 years ago

On FreeBSD 13.0 / amd64, I have 4 SATA disks (ada0, ada1, ada2, ada3) used in a ZFS RAID-Z1 filesystem :

$ sysctl kern.disks
kern.disks: ada5 ada4 ada3 ada2 ada1 ada0

$ zpool list -v
NAME                                             SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
tank                                            5.44T  2.78T  2.66T        -         -      -    51%  1.00x    ONLINE  -
  raidz1                                        5.44T  2.78T  2.66T        -         -      -  51.1%      -  ONLINE
    gpt/zfs                                         -      -      -        -         -      -      -      -  ONLINE
    gptid/6a63e7be-a817-4f48-d1e7-8eb51f2ab127      -      -      -        -         -      -      -      -  ONLINE
    gptid/3241c64a-282f-2449-d799-bb00de95ecb2      -      -      -        -         -      -      -      -  ONLINE
    gptid/dedca703-d054-67e9-8a8b-c79b3c4284ca      -      -      -        -         -      -      -      -  ONLINE

With your script lsblk, the FS type for the 4 disks/partitions is not detected properly, apple-zfs instead of freebsd-zfs :

./lsblk ada0
DEVICE         MAJ:MIN SIZE TYPE                                          LABEL MOUNT
ada0             0:116 1.4T GPT                                               - -
  <FREE>         -:-   111K -                                                 - -
  ada0p1         0:117 1.4T apple-zfs                                   gpt/zfs -
  ada0p9         0:118 8.0M solaris-reserved   
vermaden commented 2 years ago

Hi,

can you show me output of this commands on your computer:

# gpart show -p   
# gpart show -p -r

Thanks.

lcheylus commented 2 years ago
$ gpart show -p
=>        34  2930277101    ada0  GPT  (1.4T)
          34         222          - free -  (111K)
         256  2930260495  ada0p1  apple-zfs  (1.4T)
  2930260751       16384  ada0p9  solaris-reserved  (8.0M)

=>        34  2930277101    ada1  GPT  (1.4T)
          34         222          - free -  (111K)
         256  2930260495  ada1p1  apple-zfs  (1.4T)
  2930260751       16384  ada1p9  solaris-reserved  (8.0M)

=>        34  2930277101    ada2  GPT  (1.4T)
          34         222          - free -  (111K)
         256  2930260495  ada2p1  apple-zfs  (1.4T)
  2930260751       16384  ada2p9  solaris-reserved  (8.0M)

=>        34  2930277101    ada3  GPT  (1.4T)
          34         222          - free -  (111K)
         256  2930260495  ada3p1  apple-zfs  (1.4T)
  2930260751       16384  ada3p9  solaris-reserved  (8.0M)

=>       0  39102336   ada4  BSD  (19G)
         0  35651584  ada4a  freebsd-ufs  (17G)
  35651584   3450751  ada4b  freebsd-swap  (1.6G)
  39102335         1         - free -  (512B)
$ gpart show -p -r
=>        34  2930277101    ada0  GPT  (1.4T)
          34         222          - free -  (111K)
         256  2930260495  ada0p1  6a898cc3-1dd2-11b2-99a6-080020736631  (1.4T)
  2930260751       16384  ada0p9  6a945a3b-1dd2-11b2-99a6-080020736631  (8.0M)

=>        34  2930277101    ada1  GPT  (1.4T)
          34         222          - free -  (111K)
         256  2930260495  ada1p1  6a898cc3-1dd2-11b2-99a6-080020736631  (1.4T)
  2930260751       16384  ada1p9  6a945a3b-1dd2-11b2-99a6-080020736631  (8.0M)

=>        34  2930277101    ada2  GPT  (1.4T)
          34         222          - free -  (111K)
         256  2930260495  ada2p1  6a898cc3-1dd2-11b2-99a6-080020736631  (1.4T)
  2930260751       16384  ada2p9  6a945a3b-1dd2-11b2-99a6-080020736631  (8.0M)

=>        34  2930277101    ada3  GPT  (1.4T)
          34         222          - free -  (111K)
         256  2930260495  ada3p1  6a898cc3-1dd2-11b2-99a6-080020736631  (1.4T)
  2930260751       16384  ada3p9  6a945a3b-1dd2-11b2-99a6-080020736631  (8.0M)

=>       0  39102336   ada4  BSD  (19G)
         0  35651584  ada4a  7  (17G)
  35651584   3450751  ada4b  1  (1.6G)
  39102335         1         - free -  (512B)
vermaden commented 2 years ago

As you can see from the gpart(8) output you have your partitions marked as apple-zfs instead of freebsd-zfs.

The lsblk(8) takes information from gpart(8).

You can modify these partitions to be freebsd-zfs partitions instead of apple-zfs partitions - but the lsblk(8) works correctly here trusting gpart(8) output.

Regards.