Skip to content

Instantly share code, notes, and snippets.

@CMCDragonkai
Last active March 31, 2024 08:32
Show Gist options
  • Save CMCDragonkai/f9c9cf19b92bec90da06d8ee2bcf0076 to your computer and use it in GitHub Desktop.
Save CMCDragonkai/f9c9cf19b92bec90da06d8ee2bcf0076 to your computer and use it in GitHub Desktop.

Revisions

  1. CMCDragonkai revised this gist Dec 16, 2020. 1 changed file with 8 additions and 1 deletion.
    9 changes: 8 additions & 1 deletion new_disk_zfs_raid_0.md
    Original file line number Diff line number Diff line change
    @@ -14,12 +14,19 @@ zpool add rpool "$hdd-part1"

    After adding a disk to the pool, you may find disk corruptions.

    You can try to restore the file or just delete it.
    ```
    zpool status -v
    ```

    You can try to restore the corrupted files or just delete them if they don't matter.

    Then you have to try to scrub the pool:

    ```
    # this will try to repair everything (do this after deletion or restoration)
    zpool scrub rpool
    # when all errors are finally repaired or dropped, do this to clear the state of the pool
    zpool clear rpool
    ```

  2. CMCDragonkai revised this gist Dec 15, 2020. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions new_disk_zfs_raid_0.md
    Original file line number Diff line number Diff line change
    @@ -2,6 +2,8 @@

    When adding a new disk to ZFS RAID-0, you must ensure that the disk has the same storage size as the other disks.

    You will need the `gptfdisk` package to use `sgdisk`.

    ```sh
    hdd='/dev/disk/by-id/<DISKNAME>'
    zpool labelclear -f "$hdd" || true
  3. CMCDragonkai created this gist Dec 15, 2020.
    25 changes: 25 additions & 0 deletions new_disk_zfs_raid_0.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    # Adding a new disk ZFS RAID-0

    When adding a new disk to ZFS RAID-0, you must ensure that the disk has the same storage size as the other disks.

    ```sh
    hdd='/dev/disk/by-id/<DISKNAME>'
    zpool labelclear -f "$hdd" || true
    sgdisk --zap-all "$hdd"
    sgdisk -n 1:0:0 -t 1:8300 -c 1:"Main Data" "$hdd"
    zpool add rpool "$hdd-part1"
    ```

    After adding a disk to the pool, you may find disk corruptions.

    You can try to restore the file or just delete it.

    Then you have to try to scrub the pool:

    ```
    zpool scrub rpool
    zpool clear rpool
    ```

    * https://docs.oracle.com/cd/E18752_01/html/819-5461/gbbwl.html
    * http://unixetc.co.uk/2012/01/22/zfs-corruption-persists-in-unlinked-files/