[LU-2333] Cannot mount a MGS device backed by ZFS if "--fsname" was not passed to mkfs.lustre Created: 14/Nov/12  Updated: 19/Apr/13  Resolved: 13/Dec/12

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.4.0
Fix Version/s: Lustre 2.4.0

Type: Bug Priority: Blocker
Reporter: Prakash Surya (Inactive) Assignee: Alex Zhuravlev
Resolution: Fixed Votes: 0
Labels: LB

Severity: 3
Rank (Obsolete): 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.



 Comments   
Comment by Peter Jones [ 15/Nov/12 ]

Alex will triage this one

Comment by Alex Zhuravlev [ 15/Nov/12 ]

http://review.whamcloud.com/4592

Comment by Alex Zhuravlev [ 15/Nov/12 ]

I think it should be fine do not check fsname: the presence of lustre:fsname is verified by zfs_read_ldd(). and MGS does not need fsname to run.

Comment by Alex Zhuravlev [ 13/Dec/12 ]

landed on master

Generated at Sat Feb 10 01:24:20 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.