adding another ssd for log and cache

Just added another 60GB SSD to my ZFS pool. Has been a little nightmare – Not because of ZFS. I messed up sgdisk which does not follow the usual $source $target ordering… (so yeah, I removed my partition table.. recreating, grub-install, update-grub and everything was fine).

Before I started to add the partitions from the new SSD to my pool I removed the old cache and log from my pool. That is because I want to rename them / make them useable through /dev/disk/by-partlabel:

root@janice:/dev/disk/by-partlabel# zpool offline storage /dev/disk/by-id/ata-ADATA_SP900_xxx-part4
root@janice:/dev/disk/by-partlabel# zpool offline storage /dev/disk/by-id/ata-ADATA_SP900_xxx-part5
root@janice:/dev/disk/by-partlabel# zpool status
  pool: storage
 state: DEGRADED
status: One or more devices has been taken offline by the administrator.
        Sufficient replicas exist for the pool to continue functioning in a
        degraded state.
action: Online the device using 'zpool online' or replace the device with
        'zpool replace'.
  scan: scrub repaired 0 in 43h20m with 0 errors on Fri Nov 20 18:18:25 2015
config:
 
        NAME                                              STATE     READ WRITE CKSUM
        storage                                           DEGRADED     0     0     0
          mirror-0                                        ONLINE       0     0     0
            scsi-3600050e086e0080099480000acb70000-part1  ONLINE       0     0     0
            scsi-3600050e086e3640034360000c9810000-part1  ONLINE       0     0     0
          mirror-1                                        ONLINE       0     0     0
            ST2000VX000-1ES164_xxxx                       ONLINE       0     0     0
            ata-ST2000VX000-1ES164_xxx-part1              ONLINE       0     0     0
          mirror-2                                        ONLINE       0     0     0
            ata-TOSHIBA_DT01ACA200_xxxx-part1             ONLINE       0     0     0
            ata-ST2000VX000-1ES164_xxxx-part1             ONLINE       0     0     0
        logs
          ata-ADATA_SP900_xxxx-part4                      OFFLINE      0     0     0
        cache
          ata-ADATA_SP900_xxxx-part5                      OFFLINE      0     0     0
 
errors: No known data errors
root@janice:/dev/disk/by-partlabel# zpool remove storage /dev/disk/by-id/ata-ADATA_SP900_xxx-part5
root@janice:/dev/disk/by-partlabel# zpool remove storage /dev/disk/by-id/ata-ADATA_SP900_xxx-part4
root@janice:/dev/disk/by-partlabel# zpool status
  pool: storage
 state: ONLINE
  scan: scrub repaired 0 in 43h20m with 0 errors on Fri Nov 20 18:18:25 2015
config:
 
        NAME                                              STATE     READ WRITE CKSUM
        storage                                           ONLINE       0     0     0
          mirror-0                                        ONLINE       0     0     0
            scsi-3600050e086e0080099480000acb70000-part1  ONLINE       0     0     0
            scsi-3600050e086e3640034360000c9810000-part1  ONLINE       0     0     0
          mirror-1                                        ONLINE       0     0     0
            ST2000VX000-1ES164_xxxx                       ONLINE       0     0     0
            ata-ST2000VX000-1ES164_xxxx-part1             ONLINE       0     0     0
          mirror-2                                        ONLINE       0     0     0
            ata-TOSHIBA_DT01ACA200_xxxx-part1             ONLINE       0     0     0
            ata-ST2000VX000-1ES164_xxxx-part1             ONLINE       0     0     0
 
errors: No known data errors

Here I do set their new names…

root@janice:/dev/disk/by-partlabel# gdisk /dev/sda
GPT fdisk (gdisk) version 0.8.10
 
Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present
 
Found valid GPT with protective MBR; using GPT.
 
Command (? for help): c
Partition number (1-5): 4
Enter name: ADATA_SP900_xxxx_log
 
Command (? for help): c
Partition number (1-5): 5
Enter name: ADATA_SP900_xxxx_cache
 
Command (? for help): w
 
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!
 
Do you want to proceed? (Y/N): Y
OK; writing new GUID partition table (GPT) to /dev/sda.
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot.
The operation has completed successfully.
root@janice:/dev/disk/by-partlabel# partprobe
root@janice:/dev/disk/by-partlabel# ls
ADATA_SP600_xxxx_cache  ADATA_SP900_xxxx_cache  BIOS\x20boot\x20partition  DT01ACA200-xxxx
rootfs   ST2000DM001-1ER164-xxxx ST2000VX000-1ES164-xxxx
ADATA_SP600_xxxx_log    ADATA_SP900_xxxx_log    DT01ACA200-xxxx       Linux\x20swap
rootfs2  ST2000VX000-1ES164-xxxx  ST2000VX000-1ES164_xxxx
root@janice:/dev/disk/by-partlabel# ls -la
total 0
drwxr-xr-x 2 root root 320 Nov 25 21:38 .
drwxr-xr-x 8 root root 160 Nov 25 21:21 ..
lrwxrwxrwx 1 root root  10 Nov 25 21:38 ADATA_SP600_xxxx_cache -> ../../sdb5
lrwxrwxrwx 1 root root  10 Nov 25 21:38 ADATA_SP600_xxxx_log -> ../../sdb4
lrwxrwxrwx 1 root root  10 Nov 25 21:38 ADATA_SP900_xxxx_cache -> ../../sda5
lrwxrwxrwx 1 root root  10 Nov 25 21:38 ADATA_SP900_xxxx_log -> ../../sda4
lrwxrwxrwx 1 root root  10 Nov 25 21:38 BIOS\x20boot\x20partition -> ../../sdb1
lrwxrwxrwx 1 root root  10 Nov 25 21:38 DT01ACA200-xxxx -> ../../sdh1
lrwxrwxrwx 1 root root  10 Nov 25 21:38 DT01ACA200-xxxx -> ../../sdf1
lrwxrwxrwx 1 root root  10 Nov 25 21:38 Linux\x20swap -> ../../sdb3
lrwxrwxrwx 1 root root  10 Nov 25 21:32 rootfs -> ../../sda2
lrwxrwxrwx 1 root root  10 Nov 25 21:38 rootfs2 -> ../../sdb2
lrwxrwxrwx 1 root root  10 Nov 25 21:38 ST2000DM001-1ER164-xxxx -> ../../sdg1
lrwxrwxrwx 1 root root  10 Nov 25 21:38 ST2000VX000-1ES164-xxxx -> ../../sdd1
lrwxrwxrwx 1 root root  10 Nov 25 21:38 ST2000VX000-1ES164-xxxx -> ../../sde1
lrwxrwxrwx 1 root root  10 Nov 25 21:38 ST2000VX000-1ES164_xxxx -> ../../sdc1

Now I am adding them to my pool:

root@janice:/dev/disk/by-partlabel# zpool add -o ashift=12 storage \
  log mirror /dev/disk/by-partlabel/ADATA_SP600_xxx_log /dev/disk/by-partlabel/ADATA_SP900_xxx_log \
  cache /dev/disk/by-partlabel/ADATA_SP600_xxx_cache /dev/disk/by-partlabel/ADATA_SP900_xxx_cache
root@janice:/dev/disk/by-partlabel# zpool status
  pool: storage
 state: ONLINE
  scan: scrub repaired 0 in 43h20m with 0 errors on Fri Nov 20 18:18:25 2015
config:
 
        NAME                                              STATE     READ WRITE CKSUM
        storage                                           ONLINE       0     0     0
          mirror-0                                        ONLINE       0     0     0
            scsi-3600050e086e0080099480000acb70000-part1  ONLINE       0     0     0
            scsi-3600050e086e3640034360000c9810000-part1  ONLINE       0     0     0
          mirror-1                                        ONLINE       0     0     0
            ST2000VX000-1ES164_xxxx                       ONLINE       0     0     0
            ata-ST2000VX000-1ES164_xxxx-part1             ONLINE       0     0     0
          mirror-2                                        ONLINE       0     0     0
            ata-TOSHIBA_DT01ACA200_xxxx-part1             ONLINE       0     0     0
            ata-ST2000VX000-1ES164_xxxx-part1             ONLINE       0     0     0
        logs
          mirror-3                                        ONLINE       0     0     0
            ADATA_SP600_xxxx_log                          ONLINE       0     0     0
            ADATA_SP900_xxxx_log                          ONLINE       0     0     0
        cache
          ADATA_SP600_xxxx_cache                          ONLINE       0     0     0
          ADATA_SP900_xxxx_cache                          ONLINE       0     0     0
 
errors: No known data errors

just to make sure everything is okay..

root@janice:/dev/disk/by-partlabel# zpool scrub storage
root@janice:/dev/disk/by-partlabel# zpool status
  pool: storage
 state: ONLINE
  scan: scrub in progress since Wed Nov 25 21:43:30 2015
        1.26G scanned out of 2.65T at 53.8M/s, 14h21m to go
        0 repaired, 0.05% done
 
...
 
  pool: storage
 state: ONLINE
  scan: scrub in progress since Wed Nov 25 21:43:30 2015
        57.7G scanned out of 2.65T at 224M/s, 3h22m to go
        0 repaired, 2.13% done
 
...

Looks good. Now I just need to modify the remaining discs which show -part1 and begin with ata_ to look like the others…

zpool export storage
zpool import -d /dev/disk/by-partlabel storage

No Comments

Post a Comment