Comment 9 for bug 1571761

Revision history for this message
Richard Laager (rlaager) wrote :

> Ah, I see. So do file systems from ZFS have a separate equivalent to
> /etc/fstab?

Yes, each filesystem has a "mountpoint" property. This can be set directly, and is also inherited automatically. For example, I have rpool's mountpoint set to / and then rpool/home automatically inherits /home as its mountpoint. I also have rpool/home/root with a custom mountpoint set of /root. For a more complete list, see section 3.3 of my HOWTO:
https://github.com/rlaager/zfs/wiki/HOWTO-install-Ubuntu-to-a-Native-ZFS-Root-Filesystem

> It's really best to completely drop the idea of "all devices".

I think I might have done a bad job of explaining my point. Let me try again.

Imagine I have a raidz2 ("RAID-6", can survive two disks missing) with 6 disks. I want the daemon to import that pool as soon as all 6 disks are present. I also want it to import the pool if 4 (or 5) disks are present, but only after a short timeout where no new disks have been detected. That is, I do not want the pool to import in a degraded state when the first 4 disks are present, only to have the 5th and 6th show up milliseconds later.

The daemon would handle each disk one-by-one. It would track the information about discovered pools in memory. After each new disk is discovered and we've identified the pool it belongs to (C/glib pseudo-code follows):
handle_disk_arrival(disk) {
    /* TODO: read details from disk, initialize some pool object */

    if (has_sufficient_disks(pool)) {
        g_source_remove_by_funcs_user_data(import_pool, pool);
        if (has_all_disks(pool)) {
           g_timeout_add(0, import_pool, pool);
        } else {
           g_timeout_add(500, import_pool, pool);
       }
    }
}

import_pool(zpool *pool) {
    /* TODO: import the pool */
    return FALSE;
}