|
|

06-22-2008, 02:03 AM
|
|
|
indexing symbolic links
Is there a way to index symbolic links in ext3? For example, I want to keep track of all symbolic links on the filesystem (soft mainly). I think I would have to write a wrapper around ln to keep it in a database, but I was wondering if anyone has done something similar to this.
TIA
_______________________________________________
Ext3-users mailing list
Ext3-users@redhat.com
https://www.redhat.com/mailman/listinfo/ext3-users
|
|

06-22-2008, 08:18 AM
|
|
|
indexing symbolic links
--On 21 June 2008 22:03:03 -0400 Mag Gam <magawake@gmail.com> wrote:
Is there a way to index symbolic links in ext3? For example, I want to
keep track of all symbolic links on the filesystem (soft mainly). I think
I would have to write a wrapper around ln to keep it in a database, but I
was wondering if anyone has done something similar to this.
How about
find [mount point] -type l -x -print
Wrapping ln won't do the job completely as (a) it won't track the links
being removed (e.g. via rm), and (b) it won't track links being created
by programs other than ln which use the library or the system call
directly.
When you say "mainly soft", remember EVERY file /is/ a hard link. Just
some files have more than one. Look at the "-links" option to find, which
is easy enough for normal files though you will have to do a bit of thinking
re hard linked directories, "." and "..".
Alex
_______________________________________________
Ext3-users mailing list
Ext3-users@redhat.com
https://www.redhat.com/mailman/listinfo/ext3-users
|
|

06-22-2008, 01:12 PM
|
|
|
indexing symbolic links
Find or ls I can check for symbolic links, but the file system is very large. About 250GB and I have several of them.
I was wondering if* ext3 kept track of these things, apparently it does not.
At my university, we have physical storage in a filesystem, and we assign professors and students space by doing a symbolic link. Basically I want to keep track of physical storage with virtual/logical storage. Thats why I ask :-)
TIA
On Sun, Jun 22, 2008 at 4:18 AM, Alex Bligh <alex@alex.org.uk> wrote:
--On 21 June 2008 22:03:03 -0400 Mag Gam <magawake@gmail.com> wrote:
Is there a way to index symbolic links in ext3? For example, I want to
keep track of all symbolic links on the filesystem (soft mainly). I think
I would have to write a wrapper around ln to keep it in a database, but I
was wondering if anyone has done something similar to this.
How about
*find [mount point] -type l -x -print
Wrapping ln won't do the job completely as (a) it won't track the links
being removed (e.g. via rm), and (b) it won't track links being created
by programs other than ln which use the library or the system call
directly.
When you say "mainly soft", remember EVERY file /is/ a hard link. Just
some files have more than one. Look at the "-links" option to find, which
is easy enough for normal files though you will have to do a bit of thinking
re hard linked directories, "." and "..".
Alex
_______________________________________________
Ext3-users mailing list
Ext3-users@redhat.com
https://www.redhat.com/mailman/listinfo/ext3-users
|
|

06-22-2008, 04:05 PM
|
|
|
indexing symbolic links
If you're only counting when YOU create and remove links, then you could put a hook and count from there. (without depending on anything within ext3)
If, on the other hand, you're depending on when ANYBODY creates or removes a link (hard or soft), then you have a good bit more work to do.* The only way that I can think of to do that would be to put a link into the ext3 driver -- but you wouldn't just have to log the symlink calls. you'd also have to track things like renames* (in-directory vs cross-directory vs cross-filesystem) and unlinks (rm)
Given that it sounds like you're doing symlinks and the target files aren't actually being owned by the person in question, it doesn't sound like the quota system would do the job for you, so you're probably going to need tro either do some kernel hacking, or write a batch job that runs regularly that does the information collection for you.
2008/6/22 Mag Gam <magawake@gmail.com>:
Find or ls I can check for symbolic links, but the file system is very large. About 250GB and I have several of them.
I was wondering if* ext3 kept track of these things, apparently it does not.
At my university, we have physical storage in a filesystem, and we assign professors and students space by doing a symbolic link. Basically I want to keep track of physical storage with virtual/logical storage. Thats why I ask :-)
TIA
--
Stephen Samuel http://www.bcgreen.com
778-861-7641
_______________________________________________
Ext3-users mailing list
Ext3-users@redhat.com
https://www.redhat.com/mailman/listinfo/ext3-users
|
|

06-22-2008, 06:25 PM
|
|
|
indexing symbolic links
wow, i didn't think about renames and all.
I am not a strong C programmer so I don't think hacking the kernel is an option :-(
I bet there is more to this also...
Thanks for your thoughts.
On Sun, Jun 22, 2008 at 12:05 PM, Stephen Samuel <darkonc@gmail.com> wrote:
If you're only counting when YOU create and remove links, then you could put a hook and count from there. (without depending on anything within ext3)
If, on the other hand, you're depending on when ANYBODY creates or removes a link (hard or soft), then you have a good bit more work to do.* The only way that I can think of to do that would be to put a link into the ext3 driver -- but you wouldn't just have to log the symlink calls. you'd also have to track things like renames* (in-directory vs cross-directory vs cross-filesystem) and unlinks (rm)
Given that it sounds like you're doing symlinks and the target files aren't actually being owned by the person in question, it doesn't sound like the quota system would do the job for you, so you're probably going to need tro either do some kernel hacking, or write a batch job that runs regularly that does the information collection for you.
2008/6/22 Mag Gam <magawake@gmail.com>:
Find or ls I can check for symbolic links, but the file system is very large. About 250GB and I have several of them.
I was wondering if* ext3 kept track of these things, apparently it does not.
At my university, we have physical storage in a filesystem, and we assign professors and students space by doing a symbolic link. Basically I want to keep track of physical storage with virtual/logical storage. Thats why I ask :-)
TIA
--
Stephen Samuel http://www.bcgreen.com
778-861-7641
_______________________________________________
Ext3-users mailing list
Ext3-users@redhat.com
https://www.redhat.com/mailman/listinfo/ext3-users
|
|

06-22-2008, 07:04 PM
|
|
|
indexing symbolic links
--On 22 June 2008 09:12:26 -0400 Mag Gam <magawake@gmail.com> wrote:
At my university, we have physical storage in a filesystem, and we assign
professors and students space by doing a symbolic link. Basically I want
to keep track of physical storage with virtual/logical storage. Thats why
I ask :-)
If you want to track space usage, I suggest you track it using quota
or similar. "man quota" will give you a start.
Alex
_______________________________________________
Ext3-users mailing list
Ext3-users@redhat.com
https://www.redhat.com/mailman/listinfo/ext3-users
|
|

06-22-2008, 08:37 PM
|
|
|
indexing symbolic links
Unfortunately, tracking space wasn't me goal. I want to keep track of my symbolic links :-)
On Sun, Jun 22, 2008 at 3:04 PM, Alex Bligh <alex@alex.org.uk> wrote:
--On 22 June 2008 09:12:26 -0400 Mag Gam <magawake@gmail.com> wrote:
At my university, we have physical storage in a filesystem, and we assign
professors and students space by doing a symbolic link. Basically I want
to keep track of physical storage with virtual/logical storage. Thats why
I ask :-)
If you want to track space usage, I suggest you track it using quota
or similar. "man quota" will give you a start.
Alex
_______________________________________________
Ext3-users mailing list
Ext3-users@redhat.com
https://www.redhat.com/mailman/listinfo/ext3-users
|
|

07-13-2008, 09:14 AM
|
|
|
indexing symbolic links
you can use inotify and register it to notify you when a symbolic link
created or unlinked. By this way you can put or remove names from your
database automatically, with a small C,perl,etc. program
2008/6/22 Mag Gam <magawake@gmail.com>:
> Unfortunately, tracking space wasn't me goal. I want to keep track of my
> symbolic links :-)
>
>
>
> On Sun, Jun 22, 2008 at 3:04 PM, Alex Bligh <alex@alex.org.uk> wrote:
>>
>>
>> --On 22 June 2008 09:12:26 -0400 Mag Gam <magawake@gmail.com> wrote:
>>
>>> At my university, we have physical storage in a filesystem, and we assign
>>> professors and students space by doing a symbolic link. Basically I want
>>> to keep track of physical storage with virtual/logical storage. Thats why
>>> I ask :-)
>>
>> If you want to track space usage, I suggest you track it using quota
>> or similar. "man quota" will give you a start.
>>
>> Alex
>
>
> _______________________________________________
> Ext3-users mailing list
> Ext3-users@redhat.com
> https://www.redhat.com/mailman/listinfo/ext3-users
>
_______________________________________________
Ext3-users mailing list
Ext3-users@redhat.com
https://www.redhat.com/mailman/listinfo/ext3-users
|
|

07-13-2008, 04:04 PM
|
|
|
indexing symbolic links
OH! Very nice solution. I guess I can listen to that. Thats a cool way
of doing it.
On Sun, Jul 13, 2008 at 5:14 AM, Levent Serinol <lserinol@gmail.com> wrote:
> you can use inotify and register it to notify you when a symbolic link
> created or unlinked. By this way you can put or remove names from your
> database automatically, with a small C,perl,etc. program 
>
> 2008/6/22 Mag Gam <magawake@gmail.com>:
>> Unfortunately, tracking space wasn't me goal. I want to keep track of my
>> symbolic links :-)
>>
>>
>>
>> On Sun, Jun 22, 2008 at 3:04 PM, Alex Bligh <alex@alex.org.uk> wrote:
>>>
>>>
>>> --On 22 June 2008 09:12:26 -0400 Mag Gam <magawake@gmail.com> wrote:
>>>
>>>> At my university, we have physical storage in a filesystem, and we assign
>>>> professors and students space by doing a symbolic link. Basically I want
>>>> to keep track of physical storage with virtual/logical storage. Thats why
>>>> I ask :-)
>>>
>>> If you want to track space usage, I suggest you track it using quota
>>> or similar. "man quota" will give you a start.
>>>
>>> Alex
>>
>>
>> _______________________________________________
>> Ext3-users mailing list
>> Ext3-users@redhat.com
>> https://www.redhat.com/mailman/listinfo/ext3-users
>>
>
_______________________________________________
Ext3-users mailing list
Ext3-users@redhat.com
https://www.redhat.com/mailman/listinfo/ext3-users
|
|
|
All times are GMT. The time now is 12:28 AM.
VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org
|