[LU-7395] lfs and ls failed as: Argument list too long Created: 05/Nov/15  Updated: 05/Aug/20  Resolved: 05/Aug/20

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

Type: Bug Priority: Minor
Reporter: Sarah Liu Assignee: WC Triage
Resolution: Not a Bug Votes: 0
Labels: None
Environment:

client and server: lustre-master #3226 RHEL7


Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

Not sure if there is any limitation here but running lfs and ls failed

[root@onyx-27 lustre]# lfs getstripe -M /mnt/lustre/other_dir/* |grep 1
1
1
1
1
[root@onyx-27 lustre]# lfs getstripe -M /mnt/lustre/other_dir/* |grep 0
0
0
0
[root@onyx-27 lustre]# lfs getstripe -M /mnt/lustre/migrate_dir/* |grep 0
-bash: /bin/lfs: Argument list too long
[root@onyx-27 lustre]# 
[root@onyx-27 lustre]# ls /mnt/lustre/migrate_dir/* |grep 1
-bash: /bin/ls: Argument list too long
[root@onyx-27 lustre]# lfs df -i
UUID                      Inodes       IUsed       IFree IUse% Mounted on
lustre-MDT0000_UUID      1000184         332      999852   0% /mnt/lustre[MDT:0]
lustre-MDT0001_UUID      1000184      522379      477805  52% /mnt/lustre[MDT:1]
lustre-MDT0002_UUID      1000184         236      999948   0% /mnt/lustre[MDT:2]
lustre-MDT0003_UUID      1000184         236      999948   0% /mnt/lustre[MDT:3]
lustre-OST0000_UUID       131072      131072           0 100% /mnt/lustre[OST:0]
lustre-OST0001_UUID       131072      131072           0 100% /mnt/lustre[OST:1]
lustre-OST0002_UUID       131072      131072           0 100% /mnt/lustre[OST:2]
lustre-OST0003_UUID       131072      131072           0 100% /mnt/lustre[OST:3]

filesystem summary:       523183      523183           0 100% /mnt/lustre


 Comments   
Comment by Robert Read (Inactive) [ 05/Nov/15 ]

That error is actually coming from bash, and yes there is a limitation on command line length so using wildcards on the command line is error prone.

In the case of lfs, you can use something like "find /mnt/lustre/other_dir -maxdepth 1 |xargs lfs -M | grep 0" or "lfs --recursive -M /mnt/lustre/dir | grep 0", depending on how much flexibility you need in limiting the scan. For ls you can just drop the the wildcard so ls will just list that directory or use -R option to enable recursion.

Comment by Joseph Gmitter (Inactive) [ 06/Nov/15 ]

Hi Sarah,
Is this part of a test script? At the triage call, it was discussed that the issue is using /* in the commands and should be left off to resolve the problem. however, it if is part of a test script, the script will need to be updated.
Thanks.
Joe

Comment by Andreas Dilger [ 06/Nov/15 ]

The "argument list too long" message is from the expansion of "*" on the command line.

That said, there also appears to be a problem that the 4 MDTs have 1M inodes each, but the OSTs only have 128k inodes each and they have all been used, so the filesystem can only create at most 512k files with objects. I don't know if this is also affecting your testing, but I thought I would point it out

Comment by Sarah Liu [ 09/Nov/15 ]

Hi Joe,
This is not from test script, I hit it when manually tested migration; I will try Robert's way

Generated at Sat Feb 10 02:08:32 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.