Re: [vserver] ext4 inode tagging

From: Corey Wright <undefined_at_pobox.com>
Date: Sat 14 Jan 2012 - 19:17:02 GMT
Message-Id: <20120114131702.e4d6951f.undefined@pobox.com>

On Sat, 14 Jan 2012 11:47:13 +0100
Roberto Puzzanghera <admin@sagredo.eu> wrote:

> On 01/14/2012 11:14 AM, Herbert Poetzl wrote:
> > On Sat, Jan 14, 2012 at 09:47:19AM +0100, Roberto Puzzanghera wrote:
> >> On 01/14/2012 12:48 AM, Herbert Poetzl wrote:
> >>> On Fri, Jan 13, 2012 at 07:26:13PM +0100, Roberto Puzzanghera wrote:
> >>>> On 01/13/2012 06:02 PM, Herbert Poetzl wrote:
> >>>>> On Fri, Jan 13, 2012 at 05:10:46PM +0100, Roberto Puzzanghera wrote:
> >>>>>> [...]
> >
> >>>>>>> no, I don't think that will be necessary, but
> >>>>>>> could you run the following script on your system
> >>>>>>> and provide upload the output somewhere/
> >
> >>>>>>> # mkdir /test
> >>>>>>> # testfs.sh -vvv -x -F ext4 -M /test -D<device>
> >
> >>>>>>> note that<device> should be a partition, disk or
> >>>>>>> loopback device you do not mind to be reformatted
> >>>>>>> with ext4 (all data will be destroyed)
> >
> >>>>>>> you can simply create one with:
> >>>>>>> # dd if=/dev/zero of=/path/to/somewhere bs=1M count=1024
> >>>>>>> # losetup /dev/loop0 /path/to/somewhere
> >
> >>>>>>> also, no problem to use /mnt or /media/test instead
> >>>>>>> of just /test (i.e. it doesn't matter as long as
> >>>>>>> you specify the path in -M<path>)
> >
> >>>>>>> the test script can be found here:
> >>>>>>> http://vserver.13thfloor.at/Stuff/SCRIPT/testfs.sh
> >
> >>>> # dd if=/dev/zero of=/mnt/testfs bs=1M count=1024
> >>>> # losetup /dev/loop0 /mnt/testfs
> >>>> # mount -t ext4 /dev/loop0 /mnt/tmp/
> >>>> # testfs.sh -vvv -x -F ext4 -M /mnt/tmp/ -D /dev/loop0
> >
> >>> do not mount any filesystem on /mnt/tmp and do not
> >>> mount or busy /dev/loop0 in any way, filesystem
> >>> creation and mounting will be done by testfs.sh
> >
> >> The output follows
> >
> >> best regards
> >> Roberto Puzzanghera
> >
> >
> >> # dd if=/dev/zero of=/usr/local/testfs bs=1M count=1024
> >> # losetup /dev/loop0 /usr/local/testfs
> >> # ./testfs.sh -vvv -x -F ext4 -M /mnt -D /dev/loop0
> >> Linux-VServer FS Test [V0.23] Copyright (C) 2005-2009 H.Poetzl
> >> Linux 3.1.4-vs2.3.2.1-smp x86_64/0.30.216
> >> VCI: 0002:0308 236 13000f11 (ID24)
> >> ---
> >> testing ext4 filesystem ...
> >> mke2fs 1.41.14 (22-Dec-2010)
> >> Filesystem label=
> >> OS type: Linux
> >> Block size=4096 (log=2)
> >> Fragment size=4096 (log=2)
> >> Stride=0 blocks, Stripe width=0 blocks
> >> 65536 inodes, 262144 blocks
> >> 13107 blocks (5.00%) reserved for the super user
> >> First data block=0
> >> Maximum filesystem blocks=268435456
> >> 8 block groups
> >> 32768 blocks per group, 32768 fragments per group
> >> 8192 inodes per group
> >> Superblock backups stored on blocks:
> >> 32768, 98304, 163840, 229376
> >
> >> Writing inode tables: done
> >> Creating journal (8192 blocks): done
> >> Writing superblocks and filesystem accounting information: done
> >
> >> This filesystem will be automatically checked every 24 mounts or
> >> 180 days, whichever comes first. Use tune2fs -c or -i to override.
> >> [000]# succeeded.
> >> mount -t ext4 -o rw /dev/loop0 /mnt 3>&2
> >> [001]# succeeded.
> >> mount -o remount,rw,tag /mnt 3>&2
> >> mount: /mnt not mounted already, or bad option
> >> [002]# succeeded.
> >> tag related tests ...
> >> mount -t ext4 -o rw,tag /dev/loop0 /mnt 3>&2
> >> [011]# succeeded.
> >> do_tag_touch /mnt 0 1 255 256 666
> >> touch /mnt/file_1: 0
> >> vtag --migrate --tag 0 -- touch /mnt/file_1
> >> touch /mnt/file_2: 1
> >> vtag --migrate --tag 1 -- touch /mnt/file_2
> >> touch /mnt/file_3: 255
> >> vtag --migrate --tag 255 -- touch /mnt/file_3
> >> touch /mnt/file_4: 256
> >> vtag --migrate --tag 256 -- touch /mnt/file_4
> >> touch /mnt/file_5: 666
> >> vtag --migrate --tag 666 -- touch /mnt/file_5
> >> [012]# succeeded.
> >> do_tag_verify /mnt 0 1 255 256 666
> >> verify /mnt/file_1: 0 = 0
> >> verify /mnt/file_2: 1 = 1
> >> verify /mnt/file_3: 255 = 255
> >> verify /mnt/file_4: 256 = 256
> >> verify /mnt/file_5: 666 = 666
> >> [014]# succeeded.
> >
> > this shows that tagging on ext4 works perfectly fine,
> > please verify (with 'cat /proc/mounts' on the host)
> > that your filesystem is indeed mounted with the 'tag'
> > option when you try to do tagging related operations
> >
> > note: it was observed that, for yet unknown reasons,
> > sometimes the 'tag' option isn't used/recognized
> > despite the fact that it is present in host/guest
> > fstab ...
> >
> > HTH,
> > Herbert
>
> yes, it's seems this is the case. I have the tag option in my fstab, but:
>
> # cat /proc/mounts
> /dev/sda3 /usr/local ext4
> rw,relatime,user_xattr,barrier=1,data=ordered,jqfmt=vfsv0,usrjquota=aquota.user,grpjquota=aquota.group
> 0 0

roberto, are you wanting to use disk limits
(http://linux-vserver.org/Disk_Limits_and_Quota) or user/group quotas
(http://linux-vserver.org/Quotas) on ext4?

you said you were "following the howto on the wiki" and that included
mounting with "-o tag". the disk limits wiki page details mounting with "-o
tag" (and appears to be the only wiki page that includes that:
http://www.google.com/search?q=site:linux-vserver.org+%22-o+tag%22) and disk
limits haven't worked on ext4 for some time
(http://list.linux-vserver.org/archive?mss:4959:201104:cnkmighjiiigipolfgel
and attached log).

but in your mount options you are using jqfmt, usrjquota, & grpjquota, which
is for (journalling) user/group quotas, not "disk limits". if you want
user/group quotas, then i don't believe tagging is necessary (or at least the
linux-vserver quotas wiki page doesn't specify such).

if you can clarify what you are trying to accomplish (ie "user/group quotas"
or "disk limits"), then your problem can probably be addressed more quickly
(eg if you want to do disk limits on ext4, then i could have told you it
probably doesn't work as testfs.sh says it "fails" from at least 2.6.35
through the latest 3.0.16 and following the disk limit instructions
probably won't enable user/group quotas).

corey

--
undefined@pobox.com
> tonight I will try to fix and let you know
> 
> thank you, best regards
> Roberto Puzzanghera

Received on Sat Jan 14 19:17:19 2012
[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Sat 14 Jan 2012 - 19:17:19 GMT by hypermail 2.1.8