Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-2333

Cannot mount a MGS device backed by ZFS if "--fsname" was not passed to mkfs.lustre

Details

    • Bug
    • Resolution: Fixed
    • Blocker
    • Lustre 2.4.0
    • Lustre 2.4.0
    • 3
    • 5565

    Description

      When creating a new filesystem on a VM, I ran into the following problem:

                                                                               
      $ sudo mkfs.lustre --mgs --backfstype=zfs lustre-mds/mgs > /dev/null               
      $ sudo mount.lustre lustre-mds/mgs /mnt/lustre/local/lustre-MGS0000                
      mount.lustre: lustre-mds/mgs has not been formatted with mkfs.lustre or the backend filesystem type is not supported by this tool
      

      I tracked the issue down to here:

                                                                               
      389 int zfs_is_lustre(char *ds, unsigned *mount_type)                              
      390 {                                                                              
      391         struct lustre_disk_data tmp_ldd;                                       
      392         int ret;                                                               
      393                                                                                
      394         if (osd_zfs_setup == 0)                                                
      395                 return 0;                                                      
      396                                                                                
      397         ret = zfs_read_ldd(ds, &tmp_ldd);                                      
      398         if ((ret == 0) && (tmp_ldd.ldd_config_ver > 0) &&                      
      399             (strlen(tmp_ldd.ldd_fsname) > 0) &&                                
      400             (strlen(tmp_ldd.ldd_svname) > 0)) {                                
      401                 *mount_type = tmp_ldd.ldd_mount_type;                          
      402                 return 1;                                                      
      403         }                                                                      
      404                                                                                
      405         return 0;                                                              
      406 }                                                                              
      

      Specifically, this line:

                                                                               
      399             (strlen(tmp_ldd.ldd_fsname) > 0) &&                                
      

      Since I did not specify the -fsname option to mkfs.lustre, mount.lustre fails to recognize the data properly. Reformatting the data set, using the -fsname option mitigates the issue.

      As you can see, there is no lustre:fsname property.

                                                                               
      $ sudo zfs get all lustre-mds/mgs | grep lustre:                                   
      lustre-mds/mgs  lustre:flags          100                    local                 
      lustre-mds/mgs  lustre:svname         MGS                    local                 
      lustre-mds/mgs  lustre:version        1                      local                 
      lustre-mds/mgs  lustre:index          65535                  local                 
      

      For starters, the error reporting is horrible in this instance. I had to crack open GDB and step through the mount.lustre executable to figure out what was failing.

      And secondly, the user tools should either allow the MGS to be mounted without a "fsname" (if that's possible?), or fail the mkfs.lustre command with a useful error message if --fsname is not provided.

      Attachments

        Activity

          People

            bzzz Alex Zhuravlev
            prakash Prakash Surya (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: