From: jellybean stonerfish on
On Wed, 24 Feb 2010 23:05:30 -0700, Phred Phungus wrote:


>>
>>
> Alright, thx Dave, any thoughts on why /etc/ is involved in these links?
>
>

Are you using a Debian System.
http://www.debian-administration.org/articles/91
From: Bit Twister on
On Thu, 25 Feb 2010 06:36:36 GMT, jellybean stonerfish wrote:

> Are you using a Debian System.
> http://www.debian-administration.org/articles/91

As an FYI, Mandriva Linux uses the /etc/alternatives method.
$ ls /etc/alternatives | wc -l
122
From: Phred Phungus on
Bit Twister wrote:
> On Thu, 25 Feb 2010 06:36:36 GMT, jellybean stonerfish wrote:
>
>> Are you using a Debian System.
>> http://www.debian-administration.org/articles/91
>
> As an FYI, Mandriva Linux uses the /etc/alternatives method.
> $ ls /etc/alternatives | wc -l
> 122


Ubuntu is debian, I think.

$ ls /etc/alternatives | wc -l
155
$ ls -l /etc/alternatives/
total 8
lrwxrwxrwx 1 root root 13 2009-12-13 17:59 awk -> /usr/bin/mawk
lrwxrwxrwx 1 root root 29 2009-12-13 17:59 awk.1.gz ->
/usr/share/man/man1/mawk.1.gz
....


There's definitely close to 8 score entries here. What's with the
total 8
?

--
fred
From: Alan Curry on
In article <7updh6F84rU1(a)mid.individual.net>,
Phred Phungus <Phred(a)example.invalid> wrote:
|
|$ ls -l /etc/alternatives/
|total 8
|lrwxrwxrwx 1 root root 13 2009-12-13 17:59 awk -> /usr/bin/mawk
|lrwxrwxrwx 1 root root 29 2009-12-13 17:59 awk.1.gz ->
|/usr/share/man/man1/mawk.1.gz
|...
|
|
|There's definitely close to 8 score entries here. What's with the
|total 8

The "total" at the top of an ls -l is the total of the st_blocks values of
all the listed entries. You can see the individual st_blocks with ls -s.

st_blocks is the number of disk blocks allocated to store the file's data
(with a "block" being defined as either 512 bytes or 1024 bytes depending
on your ls version and options)

That directory is mostly full of symlinks. A symlink contains no data of
its own, just the name of another file. For example the "data" for your awk
link is "/usr/bin/mawk", occupying only 13 bytes. If you run
ls -s /etc/alternatives/awk
you'll probably find that it has 0 blocks allocated.

So how can 13 bytes be stored in 0 blocks? "Fast symlinks". The symlink
data, if it's small enough, is stored in the inode, the same place where
the timestamps and permissions and other metadata is kept. The inode
doesn't count toward st_blocks.

On my system, /etc/alternatives contains 209 symlinks and a README file,
and instead of "total 8" I get "total 4". You must have a bigger README
file, or mabye one of your symlinks is really long.

--
Alan Curry