Skip to contentSkip to conversation

sysfs directories...

DISCUSSION Adrian Almenar 5 participants 5 messages Jun 18, 2004 – Jun 19, 2004

lore
Share & tools
lore
#0 lore raw

i was looking at /sys on my machine yesterday and i found something strange.

cd /sys/block/hda/device/block/device/block/device/block/device/block/... and that continues being almost infinite and recursive, it is normal ???

My Kernel Version is: 2.6.7-rc3

Cheers,

Signature · 1 line
Adrian Almenar
#1 lore raw
Quoted 6 lines · * Adrian Almenar ([email protected]) wrote:

i was looking at /sys on my machine yesterday and i found something strange.

cd /sys/block/hda/device/block/device/block/device/block/device/block/... and that continues being almost infinite and recursive, it is normal

Both /sys/block/hda/device and the next element 'block' are symlinks, so it'll top out after 40 (enforced by vfs).

thanks,
-chris

Signature · 1 line
Linux Security Modules     http://lsm.immunix.org     http://lsm.bkbits.net
#2 lore raw
In reply to Adrian Almenar
Quoted 7 lines · Adrian Almenar

i was looking at /sys on my machine yesterday and i found something strange.

cd /sys/block/hda/device/block/device/block/device/block/device/block/... and that continues being almost infinite and recursive, it is normal ???

Consult your favourite Unix textbook and look up "symbolic links". Then look again at /sys/block/hda/device.

Andreas.

Signature · 4 lines
Andreas Schwab, SuSE Labs, [email protected]
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
#3 lore raw
In reply to Adrian Almenar
Quoted 7 lines · Adrian Almenar

i was looking at /sys on my machine yesterday and i found something strange.

cd /sys/block/hda/device/block/device/block/device/block/device/block/... and that continues being almost infinite and recursive, it is normal ???

What does:
ls -l /sys/block/hda

show?

thanks,

greg k-h

#4 lore raw
In reply to Adrian Almenar
Quoted 7 lines · Adrian Almenar

i was looking at /sys on my machine yesterday and i found something strange.

cd /sys/block/hda/device/block/device/block/device/block/device/block/... and that continues being almost infinite and recursive, it is normal ???

It's a bash trick when changing dir to a symlink:

hell:/sys/block/hda$ cd device
hell:/sys/block/hda/device$ cd block
hell:/sys/block/hda/device/block$ cd device
hell:/sys/block/hda/device/block/device$ cd block
hell:/sys/block/hda/device/block/device/block$ pwd
/sys/block/hda/device/block/device/block
hell:/sys/block/hda/device/block/device/block$ /bin/pwd
/sys/block/hda
hell:/sys/block/hda/device/block/device/block/device$ pwd
/sys/block/hda/device/block/device/block/device
hell:/sys/block/hda/device/block/device/block/device$ /bin/pwd
/sys/devices/pci0000:00/0000:00:04.1/ide0/0.0

<<V13>>