AFP548 Changing the world one server at a time.

Problems with edquota -p and AD users

Home › Forums › OS X Server and Client Discussion › Active Directory › Problems with edquota -p and AD users

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #375919
    Techy
    Participant

    Hi Everyone,

    AD=Win server 2003 OD=10.5.6

    The problem I am having is that when I use the edquota -p command to set quotas for the large number (1800) of students at my site it will only set quotas for the students towards the end of my file.

    -p signifies that we are using a prototypical user as a template to setup the quotas for other users. protostu is the user I created specifically to be the prototypical user. I first set protostu’s quota then I tried to use him to set the other users up.

    (the command below sets the quota for one user at a time and opens there settings in vi)
    edquota protostu

    (vi)
    Quotas for user protostu:
    /: 1K blocks in use: 0, limits (soft = 0, hard = 102400)
    inodes in use: 0, limits (soft = 0, hard = 0)

    (the command below uses your Prototypical user as a template and sets all of the following users to the same settings)
    edquota -p protostu 010195F067 010195M030 010197F004 …………..

    If I break the file up and only set 200 students at a time it will set the first 200 just fine but when I use the command to set the next 200 it forgets the quotas set for the first 200.

    If I set the students quotas manually one by one as I have done with the teachers and the prototypical user it works great and I have had no problems as of yet. Even when I loose quotas on students that I was trying to automate with edquota -p I retain quotas on users that I set manually.

    One more interesting fact is that when I check the quota of a user set with the -p flag it never shows them as having a quota set even if they are one of the lucky few that has quotas working. the only way to check a users quota if they have been set using the -p flag is to run edquota on that user and view it in the vi editor.

    for example:

    quota 010197F004
    Disk quotas for user 010197F004 (uid 417976818): none

    edquota 010197F004

    Quotas for user 010197F004:
    /: 1K blocks in use: 0, limits (soft = 0, hard = 102400)
    inodes in use: 0, limits (soft = 0, hard = 0)

    the quota command works fine on users that I have set manually through vi.

    I have looked all over these forums and google and have even found a few posts with similar problems but no one seems to have a solution. I would even be willing to script edquota so it modified each user individually but I don’t think you can script vi.

    Thanks in advance for any help you guys can provide.

    Sincerely,
    Another Desperate Admin

    #375922
    Tom H
    Participant

    Have you tried it without the -P on a bunch of Users ?

    eg.. edquota -u 010195F067 010195M030 010197F004

    I had some issues using the -p in the past which resulted in me having to remove the quota files from the root of the volume and start again with just the standard -u it allows you to set it for multiple users at once as standard..

    #375924
    Techy
    Participant

    Actually yes I have tried it that way but it brings up each user one at a time in vi which is unacceptable given that I have 1,800 users to set each year. Thanks for the suggestion though.

    #375927
    Tom H
    Participant

    Hmm i just looked tried it again with the following and it appears to work, although i only tied 5 users.

    edquota -up quser user1 user2 user3 user4 user 5

    Only difference is ‘-up’ as far as i can see…

    #375928
    Techy
    Participant

    yes I know I haven’t been using the -u flag but when I started this project I did and it made no difference to my success with the -p flag. further it seems to make no difference when doing a standard:

    edquota user1

    The -p flag failing is definitely a problem of scale as far as I can tell as I explained in my original post:

    “If I break the file up and only set 200 students at a time it will set the first 200 just fine but when I use the command to set the next 200 it forgets the quotas set for the first 200.”

    #375929
    Tom H
    Participant

    Yes i understand what your saying my point is that your method is correct. B)

    Do these users actually have data on the volume ? If they don’t then it wont show a quota for them until they have data in place.

    Here is a quick test i did to hopefully help out with your testing.

    The ingredients :

    – A 2008 AD Domain
    – A template user called localuser as a local account on my OSX server 10.5.6.
    – 10 Test AD users to play with user1 to user10.

    Firstly I copy the template users quota to my 5 Ad Users:

    Last login: Sat Apr  4 20:41:05 on ttys000
    sh-3.2# edquota -p localuser user1 user2 user3 user4 user5 

    Then i check the quota for these 5 users (i don’t expect to see one as they have no data on the volume.

    sh-3.2# quota user1 user2 user3 user4 user5
    Disk quotas for user user1 (uid 1179662425): none
    Disk quotas for user user2 (uid 1230151183): none
    Disk quotas for user user3 (uid 1052254816): none
    Disk quotas for user user4 (uid 1570249417): none
    Disk quotas for user user5 (uid 1294295561): none

    I then create some data on the volume that belongs to one of my AD users.

    sh-3.2# cd /Volumes/Macintosh\ HD
    sh-3.2# mkdir Test
    sh-3.2# chown user4 Test/

    Test the quotas of my users again :

    sh-3.2# quota user1 user2 user3 user4 user5
    Disk quotas for user user1 (uid 1179662425): none
    Disk quotas for user user2 (uid 1230151183): none
    Disk quotas for user user3 (uid 1052254816): none
    Disk quotas for user user4 (uid 1570249417): 
         Filesystem    1K blocks         quota        limit    grace   files   quota   limit   grace
                  /            0        100000       100000                1  100000  100000        
    Disk quotas for user user5 (uid 1294295561): none

    As you can see now user4 has some data on the volume it shows up as having a quota for that user.

    A quick test to show that once the user no longer has data on the voume there quota is no longer displayed:

    sh-3.2# chown user1 Test/

    sh-3.2# quota user1 user2 user3 user4 user5
    Disk quotas for user user1 (uid 1179662425): 
         Filesystem    1K blocks         quota        limit    grace   files   quota   limit   grace
                  /            0        100000       100000                1  100000  100000        
    Disk quotas for user user2 (uid 1230151183): none
    Disk quotas for user user3 (uid 1052254816): none
    Disk quotas for user user4 (uid 1570249417): none
    Disk quotas for user user5 (uid 1294295561): none

    And as you can see user 4 no longer displays a quota, but user 1 now does.

    Set the quota to the rest of my users and check it doesn’t alter the above:

    sh-3.2# edquota -p localuser user6 user7 user8 user9 user10 
    
    sh-3.2# quota user1 user2 user3 user4 user5
    Disk quotas for user user1 (uid 1179662425): 
         Filesystem    1K blocks         quota        limit    grace   files   quota   limit   grace
                  /            0        100000       100000                1  100000  100000        
    Disk quotas for user user2 (uid 1230151183): none
    Disk quotas for user user3 (uid 1052254816): none
    Disk quotas for user user4 (uid 1570249417): none
    Disk quotas for user user5 (uid 1294295561): none

    Make another test folder and assign the owner to another AD User:

    sh-3.2# mkdir Test2
    sh-3.2# chown user3 /Test2

    Check final quotas for all 10 Ad Users:

    sh-3.2# quota user1 user2 user3 user4 user5 user6 user7 user8 user9 user10
    Disk quotas for user user1 (uid 1179662425): none
    Disk quotas for user user2 (uid 1230151183): none
    Disk quotas for user user3 (uid 1052254816): 
         Filesystem    1K blocks         quota        limit    grace   files   quota   limit   grace
                  /            0        100000       100000                1  100000  100000        
    Disk quotas for user user4 (uid 1570249417): none
    Disk quotas for user user5 (uid 1294295561): none
    Disk quotas for user user6 (uid 2086228831): none
    Disk quotas for user user7 (uid 1941827040): none
    Disk quotas for user user8 (uid 897668523): 
         Filesystem    1K blocks         quota        limit    grace   files   quota   limit   grace
                  /            0        100000       100000                1  100000  100000        
    Disk quotas for user user9 (uid 1346646431): none
    Disk quotas for user user10 (uid 1243479013): none

    As expected only the two users who have data on the volume show up as haveing a quota :mrgreen:

    Its also noting that Server Admin often gets the quota reporting wrapped around its head and reports all the users that have been set using the -p command with the username of the template user.

    Hope this helps with your testing.

    #375930
    Techy
    Participant

    I appreciate all your efforts and I will be sure to test your findings after spring break as I can not access my server right now however this still does not speak to the core of my issue.

    whether or not the users display a quota when I use the quota command to check is a trivial matter to me. What is far more disturbing is that after setting all 1800 students with edquota -p the vast majority don’t have quotas working. I have tested this by logging into their accounts on a WinXP machine where they have 1.73 TB available and I further test this by copying a file that should be greater than their quota to their folder.

    Thank you for your continued interest and efforts!

    #375933
    Tom H
    Participant

    Something else thats worth mentioning..

    If the users use AFP to connect to there home folders, there is a setting that as default updates the HomeDirQuota this needs to be turned off for use with AD users otherwise evertime they log in it just resets there quota to 0 . Doh!

    #375935
    Techy
    Participant

    Already turned that setting off. So no one has anymore ideas for me regarding my issue with edquota -p? 😥

    #375948
    Techy
    Participant

    Any chance that this is my problem?

    Quota UID and GID ranges are more limited than FreeBSD
    > otherwise limits UID/GID ranges. Make sure that “VALID_UID”
    > isn’t larger than 65535 or smaller than 0.

    I found several sites that have similar language in regard to quota’s. An example of my UID’s is 417976818. Clearly larger than the recommended max in the docs I found. OSX chose these UID’s automatically so any ideas on how to get it to reassign new UID’s within the desired range if this is my problem?

    #375950
    Tom H
    Participant

    Ok… i just rebooted the server, and guess what all my loverly quota’s have disappeared… so i recreated some quotas and tested them all worked fine again.

    Rebooted and they have gone again…. I wonder if its the Apple’s Admin Tools over writing them or something similar on boot ?

    sudo cat /private/var/db/dslocal/nodes/Default/users/localuser.plist

    I see that the Home Folder limit is specified in the users plist :

    homedirectoryquota

    524288000

    We could map the ID to a attribute in AD that contains a shorter number for testing that theory…

    #376835
    ifbell
    Participant

    I came across this thread while having my own issues with quotas. Sadly I have had no better luck but I did stumble across some interesting observations I thought I would share that might help.
    If you go into /var/db/dslocal/nodes/default and find username.plist If you have not set a quota then the field homedirectoryquota does not exist. If you add it as an array and then add a sibling string and for the value you add a value in bytes it shows up in workgroup manager as having a quota. This then persists till restart when all the above go away.

    I am not sure if this help but I thought the information was worth passing on.

    IFB

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.