Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #190028 > unrolled thread
| Started by | Dan Hitt <dan.hitt@gmail.com> |
|---|---|
| First post | 2017-12-19 19:30 +0100 |
| Last post | 2017-12-19 20:10 +0100 |
| Articles | 8 — 4 participants |
Back to article view | Back to linux.debian.user
BeFS or BFS or other filesystem for linux with attributes on debian Dan Hitt <dan.hitt@gmail.com> - 2017-12-19 19:30 +0100
Re: BeFS or BFS or other filesystem for linux with attributes on debian <tomas@tuxteam.de> - 2017-12-19 19:40 +0100
Re: BeFS or BFS or other filesystem for linux with attributes on debian Roberto C. Sánchez <roberto@debian.org> - 2017-12-19 20:10 +0100
Re: BeFS or BFS or other filesystem for linux with attributes on debian Roberto C. Sánchez <roberto@debian.org> - 2017-12-19 23:10 +0100
Re: BeFS or BFS or other filesystem for linux with attributes on debian Dan Hitt <dan.hitt@gmail.com> - 2017-12-19 23:10 +0100
Re: BeFS or BFS or other filesystem for linux with attributes on debian David Christensen <dpchrist@holgerdanske.com> - 2017-12-20 08:20 +0100
Re: BeFS or BFS or other filesystem for linux with attributes on debian Dan Hitt <dan.hitt@gmail.com> - 2017-12-21 00:10 +0100
Re: BeFS or BFS or other filesystem for linux with attributes on debian Dan Hitt <dan.hitt@gmail.com> - 2017-12-19 20:10 +0100
| From | Dan Hitt <dan.hitt@gmail.com> |
|---|---|
| Date | 2017-12-19 19:30 +0100 |
| Subject | BeFS or BFS or other filesystem for linux with attributes on debian |
| Message-ID | <uYuOm-1V8-7@gated-at.bofh.it> |
BeOS had (and i imagine Haiku has) a file system that allows all kinds of attributes to be attached to a file. I understand it to be something like having a two-column key-value table attached to every file. I understand that file system was ported to linux with the name BeFS (the Be name of 'BFS' was already in use). However, when i search around for it, i get the impression that it it is no longer under development, and the stable version was read-only anyway. So wondering if any there's any other file system around with semi-arbitrary user settable attributes and values? The reason i'm wondering, is i'd like to try one out to attach metadata to files, and i'd really like this process to be just as deep in the stack as is possible. Thanks for any info, or corrections if i'm wrong about BeFS. dan
[toc] | [next] | [standalone]
| From | <tomas@tuxteam.de> |
|---|---|
| Date | 2017-12-19 19:40 +0100 |
| Subject | Re: BeFS or BFS or other filesystem for linux with attributes on debian |
| Message-ID | <uYuY2-1YH-13@gated-at.bofh.it> |
| In reply to | #190028 |
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Tue, Dec 19, 2017 at 10:27:38AM -0800, Dan Hitt wrote: > BeOS had (and i imagine Haiku has) a file system that allows all kinds > of attributes to be attached to a file. Most self-respecting file systems on Linux have extended attributes these days (at least for a value of "ext4" for "self-respecting", that is; for the others, consult the file system's man page ;-) You need the program "attr" for that, present in the Debian package "attr" (not installed by default). Sample session: # create a file to play with: tomas@trotzki:~$ touch mumpf # set mumpf's 'color' attribute to the value 'red' tomas@trotzki:~$ attr -s color -V red mumpf Attribute "color" set to a 3 byte value for mumpf: red # list mumpf's attributes: tomas@trotzki:~$ attr -l mumpf Attribute "color" has a 3 byte value for mumpf # get mumpf's 'color' attribute's value: tomas@trotzki:~$ attr -g color mumpf Attribute "color" had a 3 byte value for mumpf: red Is that what you were looking for? Cheers - -- tomás -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlo5XOoACgkQBcgs9XrR2kYhYgCdHInAo4tBODcWUMfRpLJzygIZ Oz4Anim4XbLSNgJjQ7ySF7/XciFgM0N7 =M+du -----END PGP SIGNATURE-----
[toc] | [prev] | [next] | [standalone]
| From | Roberto C. Sánchez <roberto@debian.org> |
|---|---|
| Date | 2017-12-19 20:10 +0100 |
| Subject | Re: BeFS or BFS or other filesystem for linux with attributes on debian |
| Message-ID | <uYvr3-2pp-5@gated-at.bofh.it> |
| In reply to | #190029 |
On Tue, Dec 19, 2017 at 11:03:36AM -0800, Dan Hitt wrote: > Awesome, Tomas, awesome. > > So it was implicit in my system all this time. > > Good grief. > > Anyhow, yes, that's exactly what i was looking for. > > Well, i guess a little more: i want programmatic access to the > attributes as well. > > But obviously the attr program has programmatic access to the > attributes, so presumably all i need to do is hunt down its code and > look at it. > apt-cache search libattr Looks like C/C++ and Python are the best choices. Regards, -Roberto -- Roberto C. Sánchez
[toc] | [prev] | [next] | [standalone]
| From | Roberto C. Sánchez <roberto@debian.org> |
|---|---|
| Date | 2017-12-19 23:10 +0100 |
| Subject | Re: BeFS or BFS or other filesystem for linux with attributes on debian |
| Message-ID | <uYyff-4mJ-1@gated-at.bofh.it> |
| In reply to | #190031 |
On Tue, Dec 19, 2017 at 02:07:35PM -0800, Dan Hitt wrote:
>
> Just for reference, although the attributes exist and i ithink are
> exactly what i need, it looks like the system has to be nudged a
> little to use them.
>
> So, for example, with cp, you need to do 'cp -a' to carry along the
> attributes ('cp -p' is not enough).
>
> Also, it looks like tar has to be told about the attributes both on
> the way in and on the way out:
> tar --xattr -cf my_archive.tar my_file
> tar --xattr -xf my_archive.tar
>
You are correct that most utilities do not handle/preserve the extended
attributes by default.
> It would be nice if the system could be told to use attributes by default.
>
I am not aware of there being a system-wide setting for that.
> But that's a very small nit compared to the value of having attributes.
>
> It sure seems like a big win to be able to skip devising ways to
> encode attributes into a file format.
>
> (And it looks like the system we're using originated at SGI, then
> through Red Hat (Andreas Gruenbacher). So glad it was kept alive and
> passed along!)
>
> dan
Regards,
-Roberto
--
Roberto C. Sánchez
[toc] | [prev] | [next] | [standalone]
| From | Dan Hitt <dan.hitt@gmail.com> |
|---|---|
| Date | 2017-12-19 23:10 +0100 |
| Message-ID | <uYyff-4mJ-3@gated-at.bofh.it> |
| In reply to | #190031 |
On Tue, Dec 19, 2017 at 11:07 AM, Roberto C. Sánchez <roberto@debian.org> wrote:
> On Tue, Dec 19, 2017 at 11:03:36AM -0800, Dan Hitt wrote:
>> Awesome, Tomas, awesome.
>>
.....
>> But obviously the attr program has programmatic access to the
>> attributes, so presumably all i need to do is hunt down its code and
>> look at it.
>>
> apt-cache search libattr
>
> Looks like C/C++ and Python are the best choices.
>
> Regards,
>
> -Roberto
>
> --
> Roberto C. Sánchez
>
Thanks Roberto, for the info, and also for demoing more of the apt
capabilities. From your command it looks like perl also has support
for attributes, and i think that for any other scripting language you
could just shell out to the attr program as needed.
Just for reference, although the attributes exist and i ithink are
exactly what i need, it looks like the system has to be nudged a
little to use them.
So, for example, with cp, you need to do 'cp -a' to carry along the
attributes ('cp -p' is not enough).
Also, it looks like tar has to be told about the attributes both on
the way in and on the way out:
tar --xattr -cf my_archive.tar my_file
tar --xattr -xf my_archive.tar
It would be nice if the system could be told to use attributes by default.
But that's a very small nit compared to the value of having attributes.
It sure seems like a big win to be able to skip devising ways to
encode attributes into a file format.
(And it looks like the system we're using originated at SGI, then
through Red Hat (Andreas Gruenbacher). So glad it was kept alive and
passed along!)
dan
[toc] | [prev] | [next] | [standalone]
| From | David Christensen <dpchrist@holgerdanske.com> |
|---|---|
| Date | 2017-12-20 08:20 +0100 |
| Subject | Re: BeFS or BFS or other filesystem for linux with attributes on debian |
| Message-ID | <uYGPw-1Ok-3@gated-at.bofh.it> |
| In reply to | #190046 |
On 12/19/17 14:07, Dan Hitt wrote:
> Just for reference, although the attributes exist and i ithink are
> exactly what i need, it looks like the system has to be nudged a
> little to use them.
>
> So, for example, with cp, you need to do 'cp -a' to carry along the
> attributes ('cp -p' is not enough).
>
> Also, it looks like tar has to be told about the attributes both on
> the way in and on the way out:
> tar --xattr -cf my_archive.tar my_file
> tar --xattr -xf my_archive.tar
>
> It would be nice if the system could be told to use attributes by default.
How about using aliases?
For example, in my ~/.bashrc:
alias cp='cp -ip'
alias mv='mv -i'
See bash(1) ALIASES.
David
[toc] | [prev] | [next] | [standalone]
| From | Dan Hitt <dan.hitt@gmail.com> |
|---|---|
| Date | 2017-12-21 00:10 +0100 |
| Message-ID | <uYVER-2Xh-3@gated-at.bofh.it> |
| In reply to | #190052 |
On Tue, Dec 19, 2017 at 11:16 PM, David Christensen
<dpchrist@holgerdanske.com> wrote:
> On 12/19/17 14:07, Dan Hitt wrote:
>>
>> Just for reference, although the attributes exist and i ithink are
>> exactly what i need, it looks like the system has to be nudged a
>> little to use them.
>>
>> So, for example, with cp, you need to do 'cp -a' to carry along the
>> attributes ('cp -p' is not enough).
>>
>> Also, it looks like tar has to be told about the attributes both on
>> the way in and on the way out:
>> tar --xattr -cf my_archive.tar my_file
>> tar --xattr -xf my_archive.tar
I goofed here, should have been
tar --xattrs -cf my_archive.tar my_file
tar --xattrs -xf my_archive.tar
>>
>> It would be nice if the system could be told to use attributes by default.
>
>
> How about using aliases?
>
>
> For example, in my ~/.bashrc:
>
> alias cp='cp -ip'
> alias mv='mv -i'
>
>
> See bash(1) ALIASES.
>
>
> David
>
Thanks David.
That's a good idea, so i aliased cp to '/bin/cp -ai'
It was a little more problematic for tar (for me, at least), and i
also goofed on the tar command above :( (correction inline).
For tar, when you use the '--xattrs' option, then you must precede
your 'cf' or 'xf' with a dash. So an alias of tar='tar --xattrs'
changes how you type your tar command. (But maybe that's just a poor
choice of alias for me.)
And there's another very common program, for me, anyway, which is rsync.
For rsync, you need to add the -X option.
So i also aliased that (rsync=/usr/bin/rsync -X).
So i do still think that a global option would be useful, as the
commands with options for paying attention to attributes keep
dribbling in, but your alias idea is very helpful.
One other point on this whole attr business is that apparently the
attr program only acts on one file at a time.
That point however i can't really complain about, because if i'm
unhappy, i can just write my own attr program which will allow
multiple files to be specified. And for my use case, i probably
won't have to use attr so much anyway (just the attributes themselves,
via the interface that Roberto pointed out).
Thanks again everybody for your help, and thanks Tomas for pulling me
out of the dark ages!! :)
dan
[toc] | [prev] | [next] | [standalone]
| From | Dan Hitt <dan.hitt@gmail.com> |
|---|---|
| Date | 2017-12-19 20:10 +0100 |
| Message-ID | <uYvr3-2pp-7@gated-at.bofh.it> |
| In reply to | #190029 |
Awesome, Tomas, awesome. So it was implicit in my system all this time. Good grief. Anyhow, yes, that's exactly what i was looking for. Well, i guess a little more: i want programmatic access to the attributes as well. But obviously the attr program has programmatic access to the attributes, so presumably all i need to do is hunt down its code and look at it. dan On Tue, Dec 19, 2017 at 10:39 AM, <tomas@tuxteam.de> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On Tue, Dec 19, 2017 at 10:27:38AM -0800, Dan Hitt wrote: >> BeOS had (and i imagine Haiku has) a file system that allows all kinds >> of attributes to be attached to a file. > > Most self-respecting file systems on Linux have extended > attributes these days (at least for a value of "ext4" for > "self-respecting", that is; for the others, consult the > file system's man page ;-) > > You need the program "attr" for that, present in the Debian > package "attr" (not installed by default). > > Sample session: > > # create a file to play with: > tomas@trotzki:~$ touch mumpf > # set mumpf's 'color' attribute to the value 'red' > tomas@trotzki:~$ attr -s color -V red mumpf > Attribute "color" set to a 3 byte value for mumpf: > red > # list mumpf's attributes: > tomas@trotzki:~$ attr -l mumpf > Attribute "color" has a 3 byte value for mumpf > # get mumpf's 'color' attribute's value: > tomas@trotzki:~$ attr -g color mumpf > Attribute "color" had a 3 byte value for mumpf: > red > > Is that what you were looking for? > > Cheers > - -- tomás > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.12 (GNU/Linux) > > iEYEARECAAYFAlo5XOoACgkQBcgs9XrR2kYhYgCdHInAo4tBODcWUMfRpLJzygIZ > Oz4Anim4XbLSNgJjQ7ySF7/XciFgM0N7 > =M+du > -----END PGP SIGNATURE----- >
[toc] | [prev] | [standalone]
Back to top | Article view | linux.debian.user
csiph-web