J
J
Juhani Lahtinen2020-02-10 14:39:33
ZFS
Juhani Lahtinen, 2020-02-10 14:39:33

Can you explain a few questions about ZFS (creating a pool and types of raids)?

Good afternoon dear ones. I study possibilities of ZFS and other.
Started with a simple one, created three files for 100MB

[email protected]:~$ for i in $(seq 1 3); do dd if=/dev/zero of=~/zDisk_${i} bs=100M seek=0 count=1; done

[email protected]:~$ ls -alFi ~/ | grep zDisk
 124111 -rw-rw-r--   1 uzer uzer  104857600 фев 10 14:17 zDisk_1
 124113 -rw-rw-r--   1 uzer uzer  104857600 фев 10 14:17 zDisk_2
 124114 -rw-rw-r--   1 uzer uzer  104857600 фев 10 14:17 zDisk_3


Next we create
[email protected]:~$ sudo zpool create z_pool_m mirror ~/zDisk_1 ~/zDisk_2 ~/zDisk_3


And then we check what happens:
[email protected]:~$ sudo zpool list
NAME       SIZE  ALLOC   FREE  EXPANDSZ   FRAG    CAP  DEDUP  HEALTH  ALTROOT
z_pool_m    80M   100K  79,9M         -     1%     0%  1.00x  ONLINE  -


The question is why SIZE is 80M?
[email protected]:~$ sudo zpool status z_pool_m 
  pool: z_pool_m
 state: ONLINE
  scan: scrub repaired 0B in 0h0m with 0 errors on Mon Feb 10 13:59:15 2020
config:

  NAME                     STATE     READ WRITE CKSUM
  z_pool_m                 ONLINE       0     0     0
    mirror-0               ONLINE       0     0     0
      /home/uzer/z_disk-1  ONLINE       0     0     0
      /home/uzer/z_disk-2  ONLINE       0     0     0
      /home/uzer/z_disk-3  ONLINE       0     0     0


Checking df -h
[email protected]:~$ sudo df -h | grep z_pool_m
z_pool_m          40M            0   40M            0% /z_pool_m


Why is the size already 40M ??

Checking
[email protected]:~# pv /dev/zero > /z_pool_m/file.n00l
38,1MiB 0:00:06 [4,08MiB/s] [<=>]
pv: write failed: На устройстве не осталось свободного места


It turns out df is not lying? Why 80M and not 100M? Where did 20M go??

Second question. How exactly can you find out the type of zpool? This mirror is a raid, what is it in general??
Example:
[email protected]:~$ sudo zpool create z_pool_m  ~/zDisk_1 ~/zDisk_2 ~/zDisk_3

[email protected]:~$ sudo zpool list
NAME       SIZE  ALLOC   FREE  EXPANDSZ   FRAG    CAP  DEDUP  HEALTH  ALTROOT
z_pool_m   240M   111K   240M         -     1%     0%  1.00x  ONLINE  -

[email protected]:~$ sudo zpool status z_pool_m 
  pool: z_pool_m
 state: ONLINE
  scan: none requested
config:

  NAME                  STATE     READ WRITE CKSUM
  z_pool_m              ONLINE       0     0     0
    /home/uzer/zDisk_1  ONLINE       0     0     0
    /home/uzer/zDisk_2  ONLINE       0     0     0
    /home/uzer/zDisk_3  ONLINE       0     0     0

errors: No known data errors

[email protected]:~$ sudo df -h | grep z_pool_m
z_pool_m         120M            0  120M            0% /z_pool_m

[email protected]:~$ sudo zpool get all z_pool_m 
NAME      PROPERTY                       VALUE                          SOURCE
z_pool_m  size                           240M                           -
z_pool_m  capacity                       0%                             -
z_pool_m  altroot                        -                              default
z_pool_m  health                         ONLINE                         -
z_pool_m  guid                           9509426525379673797            -
z_pool_m  version                        -                              default
z_pool_m  bootfs                         -                              default
z_pool_m  delegation                     on                             default
z_pool_m  autoreplace                    off                            default
z_pool_m  cachefile                      -                              default
z_pool_m  failmode                       wait                           default
z_pool_m  listsnapshots                  off                            default
z_pool_m  autoexpand                     off                            default
z_pool_m  dedupditto                     0                              default
z_pool_m  dedupratio                     1.00x                          -
z_pool_m  free                           240M                           -
z_pool_m  allocated                      108K                           -
z_pool_m  readonly                       off                            -
z_pool_m  ashift                         0                              default
z_pool_m  comment                        -                              default
z_pool_m  expandsize                     -                              -
z_pool_m  freeing                        0                              -
z_pool_m  fragmentation                  1%                             -
z_pool_m  leaked                         0                              -
z_pool_m  multihost                      off                            default
z_pool_m  [email protected]_destroy          enabled                        local
z_pool_m  [email protected]_bpobj            enabled                        local
z_pool_m  [email protected]_compress           active                         local
z_pool_m  [email protected]_vdev_crash_dump  enabled                        local
z_pool_m  [email protected]_histogram     active                         local
z_pool_m  [email protected]_txg            active                         local
z_pool_m  [email protected]_birth             active                         local
z_pool_m  [email protected]_dataset     active                         local
z_pool_m  [email protected]_data          active                         local
z_pool_m  [email protected]              enabled                        local
z_pool_m  [email protected]_limits      enabled                        local
z_pool_m  [email protected]_blocks           enabled                        local
z_pool_m  [email protected]_dnode            enabled                        local
z_pool_m  [email protected]                 enabled                        local
z_pool_m  [email protected]                  enabled                        local
z_pool_m  [email protected]                  enabled                        local
z_pool_m  [email protected]_accounting     active                         loca


What type is here? Well, that is, what would be explicitly written?

Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
elbrus56, 2020-02-11
@elbrus56

The question is why SIZE is 80M?

Because when you create a pool, the FS, inodes, etc. are automatically created.
Why is the size already 40M ??

Because df was done when there was no ZFS
How exactly can you find out the type of zpool? This mirror is a raid, what is it in general??

The zpool status command shows you what's what. In the first example, you have explicitly specified mirror, in the second you have nothing written, that is, stripe.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question