LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-13-2013, 05:24 AM   #1
ravent
LQ Newbie
 
Registered: Mar 2013
Posts: 3

Rep: Reputation: Disabled
how i can create directory or symlink in /sys/bus/?


hello everyone
i want to symlink in /sys/bus/ but it goes "no file or directory found"
even tried with root permission it give the same error
 
Old 03-13-2013, 05:48 AM   #2
wildwizard
Member
 
Registered: Apr 2009
Location: Oz
Distribution: slackware64-14.0
Posts: 866

Rep: Reputation: 264Reputation: 264Reputation: 264
/sys is not a real filesystem so you can't do anything like that.
 
1 members found this post helpful.
Old 03-13-2013, 06:01 AM   #3
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
In order to create a symbolic link, you need to use following syntax:
Code:
~$ ln -s /path/to/dir /path/to/<linkname>
But if you're getting error then it indicates that /sys/bus/ doesn't really exist. Check it first:
Code:
~$ ls -la /sys/bus/
 
1 members found this post helpful.
Old 03-13-2013, 07:18 AM   #4
ravent
LQ Newbie
 
Registered: Mar 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by shivaa View Post
In order to create a symbolic link, you need to use following syntax:
Code:
~$ ln -s /path/to/dir /path/to/<linkname>
But if you're getting error then it indicates that /sys/bus/ doesn't really exist. Check it first:
Code:
~$ ls -la /sys/bus/
no its exist
ls -la /sys/
drwxr-xr-x 12 root root 0 Jan 1 1970 .
drwxr-xr-x 25 root root 1928 Jan 1 1970 ..
drwxr-xr-x 27 root root 0 Mar 13 14:16 block
drwxr-xr-x 10 root root 0 Mar 13 14:16 bus
drwxr-xr-x 37 root root 0 Mar 13 14:10 class
drwxr-xr-x 4 root root 0 Mar 13 14:16 dev
drwxr-xr-x 4 root root 0 Jan 1 1970 devices
drwxr-xr-x 2 root root 0 Mar 13 14:16 firmware
drwxr-xr-x 3 root root 0 Mar 13 14:16 fs
drwxr-xr-x 5 root root 0 Jan 1 1970 kernel
drwxr-xr-x 84 root root 0 Mar 13 14:16 module
drwxr-xr-x 2 root root 0 Mar 13 14:16 power

thanx wildwizard
but can you explain more?

Last edited by ravent; 03-13-2013 at 07:32 AM. Reason: forgot somthin
 
Old 03-13-2013, 07:42 AM   #5
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
Okay then try:
Code:
~$ ln -s /sys/bus /path/to/<linkname>
For example:
Code:
~$ ln -s /sys/bus /home/jack/mylink
~$ ls -li 
lrwx ......... mylink -> /sys/bus
 
1 members found this post helpful.
Old 03-13-2013, 08:22 AM   #6
ravent
LQ Newbie
 
Registered: Mar 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by shivaa View Post
Okay then try:
Code:
~$ ln -s /sys/bus /path/to/<linkname>
For example:
Code:
~$ ln -s /sys/bus /home/jack/mylink
~$ ls -li 
lrwx ......... mylink -> /sys/bus
this will work "ln -s /sys/bus /home/jack/mylink" but i need this which not work:
ln -s /home/jack/ /sys/bus/mylink

sorry shivaa

Last edited by ravent; 03-13-2013 at 08:46 AM.
 
Old 03-13-2013, 08:31 AM   #7
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
Just remember the simple syntax:
Code:
~$  ln  -s  /path/to/<target_directory>  /path/to/<linkname>

Anyway, Please Mark the thread as solved (option is under Thread Tools on top menu), if you think it has so.
 
1 members found this post helpful.
Old 03-13-2013, 01:33 PM   #8
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 3,116

Rep: Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339
Believe wildwizard. You can't do that. The /sys pseudo-filesystem is just a window into various kernel data structures. You can't create arbitrary files or symlinks there.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need a script to automatically create/update a symlink to the most recent directory Mountain Linux - Software 8 04-19-2009 11:57 PM
How to identify files in /sys/bus/i2c/devices/ koyi Linux - Hardware 0 07-18-2005 02:55 AM
torsmo error scandir for /sys/bus/i2c/devices/: No such file or directory KaZiber Linux - General 2 04-17-2005 03:41 AM
/proc/bus/usb is empty under 2.6.7 (but only one 1 sys) jg167 Linux - Newbie 3 08-02-2004 04:29 AM
apcupsd /sys/bus/usb/drivers/hiddev missing Toscana Linux - Hardware 3 07-16-2004 08:56 AM


All times are GMT -5. The time now is 08:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration