Project

General

Profile

Bug #11559

zfs: device removal should not block bootability

Added by Toomas Soome 11 months ago. Updated 11 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
zfs - Zettabyte File System
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

The indirect "device" should not really block us from booting. We can not (yet) boot with multiple real vdev - so we should count them. This counting is unneeded once our kernel can discover disk devices at early boot.


Related issues

Related to illumos gate - Feature #10166: loader: support com.delphix:removingClosed2018-12-26

Actions

History

#1

Updated by Toomas Soome 11 months ago

  • Related to Feature #10166: loader: support com.delphix:removing added
#2

Updated by Toomas Soome 11 months ago

Testing done:

root@test:/home/tsoome# zpool status tank
  pool: tank
 state: ONLINE
  scan: none requested
remove: Removal of vdev 1 copied 11,3M in 0h0m, completed on Tue Aug 20 18:18:17 2019
    115K memory used for removed device mappings
config:

        NAME          STATE     READ WRITE CKSUM
        tank          ONLINE       0     0     0
          c3t1d0      ONLINE       0     0     0

errors: No known data errors

This pool had 3 top level vdevs:

tank:
    version: 5000
    name: 'tank'
    state: 0
    txg: 147959
    pool_guid: 14037965421924869773
    errata: 0
    hostid: 1154954233
    hostname: 'test'
    com.delphix:has_per_vdev_zaps
    vdev_children: 3
    vdev_tree:
        type: 'root'
        id: 0
        guid: 14037965421924869773
        create_txg: 4
        children[0]:
            type: 'disk'
            id: 0
            guid: 16372114951163426922
            path: '/dev/dsk/c3t1d0s0'
            devid: 'id1,sd@n6000c29a5a2d53ce469fca171874643e/a'
            phys_path: '/pci@0,0/pci15ad,1976@10/sd@1,0:a'
            whole_disk: 1
            metaslab_array: 128
            metaslab_shift: 29
            ashift: 9
            asize: 10724048896
            is_log: 0
            create_txg: 4
            com.delphix:vdev_zap_leaf: 65
            com.delphix:vdev_zap_top: 66
        children[1]:
            type: 'indirect'
            id: 1
            guid: 3027791902507274248
            whole_disk: 0
            metaslab_array: 0
            metaslab_shift: 29
            ashift: 9
            asize: 10724048896
            is_log: 0
            com.delphix:indirect_object: 131
            com.delphix:indirect_births: 133
            com.delphix:prev_indirect_vdev: 2
            create_txg: 2498
            com.delphix:vdev_zap_top: 13
        children[2]:
            type: 'indirect'
            id: 2
            guid: 13118539433125046564
            whole_disk: 0
            metaslab_array: 0
            metaslab_shift: 29
            ashift: 9
            asize: 10724048896
            is_log: 0
            com.delphix:indirect_object: 117
            com.delphix:indirect_births: 119
            create_txg: 2923
            com.delphix:vdev_zap_top: 168
    features_for_read:
        com.delphix:hole_birth
        com.delphix:embedded_data
        com.delphix:device_removal
root@test:/home/tsoome#

root@test:/home/tsoome# zfs list
NAME                                USED  AVAIL  REFER  MOUNTPOINT
tank                               20,0M  9,18G  27,5K  /tank
tank/ROOT                          16,6M  9,18G    24K  /tank/ROOT
tank/ROOT/test                     16,6M  9,18G  16,6M  /
root@test:/home/tsoome# 

now lets set bootfs:

root@test:/home/tsoome# beadm activate test
Activated successfully
root@test:/home/tsoome# zpool get bootfs tank
NAME  PROPERTY  VALUE           SOURCE
tank  bootfs    tank/ROOT/test  local

and from loader:

ok lsdev -v
fd devices:
    fd0:   BIOS drive A (2880 X 512):
disk devices:
    disk0:   BIOS drive C (20971520 X 512):
      disk0p1: illumos ZFS         9GB
      disk0p9: Reserved         8192KB
    disk1:   BIOS drive D (62914560 X 512):
      disk1p1: EFI               256MB
      disk1p2: illumos ZFS        29GB
      disk1p9: Reserved         8192KB
    disk2:   BIOS drive E (20971520 X 512):
      disk2p1: illumos ZFS         9GB
      disk2p9: Reserved         8192KB
    disk3:   BIOS drive F (20971520 X 512):
      disk3s1: Unknown          6272KB
      disk3s2: DOS/Windows         9GB
    disk4:   BIOS drive G (20971520 X 512):
      disk4s1: Solaris 2           9GB
        disk4s1a: root           133MB
        disk4s1b: swap           133MB
        disk4s1g: usr           9930MB
        disk4s1i: boot          8032KB
zfs devices:
  pool: tank
bootfs: tank/ROOT/test
config:

        NAME STATE
        tank ONLINE
          c3t1d0s0 ONLINE
          indirect-1 ONLINE
          indirect-2 ONLINE

  pool: rpool
bootfs: rpool/ROOT/openindiana-2019:08:17
config:

        NAME STATE
        rpool ONLINE
          c3t0d0s1 ONLINE
ok show currdev
zfs:tank/ROOT/test:
ok ls
/
 d  export
 d  mnt
 d  tmp
    gfx.4th
 d  root
 d  proc
 d  dev
 d  opt
 d  kernel
 d  code
 d  rmdisk
 d  rpool
 d  lib
 d  var
 d  usr
 d  etc
 d  boot
 d  platform
 d  a
 l  bin
 d  sbin
 d  devices
 d  system
 d  hgfs
 d  zones
 d  media                                               
 d  cdrom
 d  net
 d  home
    cp850.txt
 d  floppy
    cp437.txt
    colors.txt
    cp850-utf.txt
 d  tank
 d  mmp
ok boot
Loading unix...
Loading /platform/i86pc/amd64/boot_archive...
Loading /platform/i86pc/amd64/boot_archive.hash...
Booting...
SunOS Release 5.11 Version loader-0-ga8775ac8d1 64-bit
Copyright (c) 1983, 2010, Oracle and/or its affiliates. All rights reserved.
Hostname: test

test console login: tsoome
Password: 
tsoome@test:~$ df -h
Filesystem             Size   Used  Available Capacity  Mounted on
tank/ROOT/test        9,20G  3,49G      5,70G    38%    /

and here we areā€¦

#3

Updated by Electric Monk 11 months ago

  • Status changed from In Progress to Closed
  • % Done changed from 90 to 100

git commit 21c878fe36c0151617d2f009615f5d18fddb207e

commit  21c878fe36c0151617d2f009615f5d18fddb207e
Author: Toomas Soome <tsoome@me.com>
Date:   2019-08-20T17:14:05.000Z

    11559 zfs: device removal should not block bootability
    Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Also available in: Atom PDF