Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17

Thread: Journalled quotas?

  1. #11
    Join Date
    Dec 2008
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Journalled quotas?

    @ palo_m,

    Yes, I subsequently saw the usrjquota reference. I did a my own Google search. One references was here.

    As pcmasher did not reply, I dropped the issue. It seems that there is not much interest in this at this time.

    A howto to would be great if and/or when you have the time.

  2. #12
    Join Date
    Jul 2007
    Location
    Shanghai
    Beans
    3
    Distro
    Kubuntu Jaunty Jackalope (testing)

    Re: Journalled quotas?

    OK, I couldn't wait. As soon as I came home, I had to try it.
    Short summary: it's as I already described.

    Long story follows.
    Warning: For simplicity I ran those commands under root account, so if you try to repeat the same steps, be careful during typing and think about consequences of your actions. Or use normal user for most of actions and sudo for, only mount/umount and quota-related commands need root access. It's your machine and your responsibility...
    1. Create image file for testing
      Code:
      linux:~#
      linux:~# cd /tmp
      linux:/tmp# dd if=/dev/zero of=/tmp/disk.img bs=1024 count=20000
    2. Make ext3 filesystem in image file
      Code:
      linux:/tmp# mkfs.ext3 -m 0 -L test /tmp/disk.img
      mke2fs 1.41.3 (12-Oct-2008)
      /tmp/disk.img is not a block special device.
      Proceed anyway? (y,n) y
      ...blah-blah-blah... (usual stuff displayed)
    3. Mount disk with non-journaled quota option and create some file there... just to have situation like normally used filesystem
      Code:
      linux:/tmp# mount -o loop,rw,usrquota /tmp/disk.img /mnt
      linux:/tmp# mount | grep mnt
      /tmp/disk.img on /mnt type ext3 (rw,loop=/dev/loop0,usrquota)
      linux:/tmp# mkdir /mnt/test1
      linux:/tmp# dd if=/dev/zero of=/mnt/test1/test2 bs=1024 count=100
      100+0 records in
      100+0 records out
      102400 bytes (102 kB) copied, 0.000684922 s, 150 MB/s
      linux:/tmp#
      linux:/tmp#
      linux:/tmp# ls -al /mnt/test1/
      total 103
      drwxr-xr-x 2 root root   1024 2009-04-15 21:30 .
      drwxr-xr-x 4 root root   1024 2009-04-15 21:29 ..
      -rw-r--r-- 1 root root 102400 2009-04-15 21:30 test2
      linux:/tmp# df /mnt
      Filesystem           1K-blocks      Used Available Use% Mounted on
      /tmp/disk.img            19362      1301     18061   7% /mnt
    4. Initiate non-journaled quota. It's in vfsv0 format by default, that's what we like:
      Code:
      linux:/tmp# quotacheck -c -v /mnt
      quotacheck: Your kernel probably supports journaled quota but you are not using it. Consider switching to journaled quota to avoid running quotacheck after an unclean shutdown.
      quotacheck: Scanning /dev/loop0 [/mnt] done
      quotacheck: Cannot stat old user quota file: No such file or directory
      quotacheck: Old group file not found. Usage will not be substracted.
      quotacheck: Checked 4 directories and 3 files
      quotacheck: Old file not found.
      linux:/tmp# setquota -u root 10000 15000 1000 1500 /mnt
      linux:/tmp# repquota /mnt
      *** Report for user quotas on device /dev/loop0
      Block grace time: 7days; Inode grace time: 7days
                              Block limits                File limits
      User            used    soft    hard  grace    used  soft  hard  grace
      ----------------------------------------------------------------------
      root      --    1301   10000   15000              6  1000  1500
      
      
      linux:/tmp# ls -al /mnt
      total 24
      drwxr-xr-x  4 root root  1024 2009-04-15 21:57 .
      drwxr-xr-x 23 root root  4096 2009-04-11 18:02 ..
      -rw-------  1 root root  6144 2009-04-15 21:57 aquota.user
      drwx------  2 root root 12288 2009-04-15 21:28 lost+found
      drwxr-xr-x  2 root root  1024 2009-04-15 21:30 test1
      linux:/tmp# quotacheck -v /mnt
      quotacheck: Your kernel probably supports journaled quota but you are not using it. Consider switching to journaled quota to avoid running quotacheck after an unclean shutdown.
      quotacheck: Scanning /dev/loop0 [/mnt] done
      quotacheck: Old group file not found. Usage will not be substracted.
      quotacheck: Checked 4 directories and 4 files
      Now we are in pretty much same situation on /mnt, as our real FS is - we have some files, we have quota set, all seems fine, but quotacheck -v annoys us, that we should consider journaled quota. So, we considered it already and we want it, so let's go for it.
      -
    5. Remount filesystem with journaled quota options. (See above, that file aquota.user already exists. The old quota format - vfsold - uses file quota.user instead. I guess we have no reason to use the old format anymore - and there is convertquota command for case of "historical" disks anyway.)
      Code:
      linux:/tmp# mount -o remount,loop,rw,usrjquota=aquota.user,jqfmt=vfsv0 /mnt
      linux:/tmp# mount | grep mnt
      /tmp/disk.img on /mnt type ext3 (rw,loop=/dev/loop0,usrquota,usrjquota=aquota.user,jqfmt=vfsv0)
      We can see, that previous usrquota option stayed there... Alternatively to remount, we could use umount and then mount - but the filesystem cannot be used to be able to do that, which is not always the case. So I prefer remount.
      -
    6. Let's see where we are now
      Code:
      linux:/tmp# quotacheck -v /mnt
      quotacheck: Scanning /dev/loop0 [/mnt] done
      quotacheck: Old group file not found. Usage will not be substracted.
      quotacheck: Checked 4 directories and 4 files
      linux:/tmp# repquota /mnt
      *** Report for user quotas on device /dev/loop0
      Block grace time: 7days; Inode grace time: 7days
                              Block limits                File limits
      User            used    soft    hard  grace    used  soft  hard  grace
      ----------------------------------------------------------------------
      root      --    1301   10000   15000              6  1000  1500
      Yeah, the message has gone. We are using journaled quota now!

    7. So as we tested it works with image file, we can try with real partitions. Turn quota off first, then remount it with additional "usrjquota=aquota.user,jqfmt=vfsv0" options, verify with quotacheck that it works and then turn quota back on. If all seems to work fine, one last step is to update /etc/fstab to have the mount options permanent (and if we want to be really-really sure, we can also reboot afterwards... although another remount using /etc/fstab is sufficient).

    I did not try it with grpquota (I don't use group quotas anyway), but I believe it works the same, just needs to use "grpjquota=aquota.group"... Here we go, using journaled quota now

  3. #13
    Join Date
    Dec 2008
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Journalled quotas?

    @ palo_m,

    That's great work! I believe you are the only one who has documented this feature.

  4. #14
    Join Date
    Aug 2009
    Beans
    2

    Re: Journalled quotas?

    Brilliant! Thanx a lot!

  5. #15
    Join Date
    Mar 2007
    Beans
    Hidden!

    Re: Journalled quotas?

    Tried this on 9.10 / ext4 both user and group quota's work with his tutorial.


    hi5

  6. #16
    Join Date
    Nov 2007
    Beans
    3

    Re: Journalled quotas?

    Thanks a lot for your howto!

    For me to get it to work I needed to add "grpjquota=aquota.group" to the mount options, otherwise I got the message:

    Code:
    mount: / not mounted already, or bad option
    I got this error when "grpjquota" was left out on both 9.04 and 9.10.

  7. #17
    Join Date
    Sep 2010
    Location
    Berlin
    Beans
    1

    Re: Journalled quotas?

    There is a further example of a way to start journaled quotas here: http://www.howtoforge.com/perfect-se...ispconfig-2-p4
    Look for point 12 "Journaled Quota".
    Hope this may help.
    A.

Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •