LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-23-2007, 02:28 PM   #1
shevegen
Member
 
Registered: May 2004
Distribution: Slackware / GoboLinux / LFS / VoidLinux
Posts: 145

Rep: Reputation: 26
Using /System instead of /sys ?


Hi,
I would like to use another dir name for /sys

But I dont know what exactly is needed to do this.

How does the kernel know that it must populate under /sys
and not under... say /Foobar dir?
 
Old 01-23-2007, 03:49 PM   #2
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,448
Blog Entries: 7

Rep: Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553
Why do you want to do this?
 
Old 01-23-2007, 04:09 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Do it and find out. Can be mounted (anywhere) from userspace - including fstab.
Expect things to break.
 
Old 01-23-2007, 04:45 PM   #4
Samoth
Member
 
Registered: Apr 2005
Distribution: Exherbo
Posts: 474
Blog Entries: 1

Rep: Reputation: 32
I know that Gobolinux does this with everything. The trick is to edit the line in your /etc/fstab and reflect it.
Code:
mount -t sysfs /System
Will work, I think.
 
Old 01-23-2007, 10:11 PM   #5
shevegen
Member
 
Registered: May 2004
Distribution: Slackware / GoboLinux / LFS / VoidLinux
Posts: 145

Original Poster
Rep: Reputation: 26
Yes, things break.
Symlinked ls doesnt work anymore ... kinda but it
was my mistake. Actually, no things seem to break
here for me when I mount sysfs somewhere else.

The command:
mount -t sysfs /System

Does not work

This command:
mount -t sysfs none /System

Works but my ls is broken

EDIT: Ok found out... i had kept /System as a
special dir. I now tried it with /System2
and System2 got populated

Seems to work, die /sys die die die!






There is however a problem
I cannot create new dirs in /System
nor in /sys

mkdir: cannot create directory `foo': Operation not permitted

Anyone knows how to allow creation of dirs there?

EDIT2:
Ok I didnt bother to look at the reason, but it seems to be
NOT possible to create or touch etc.. do anything with a sysfs
mounted directory. I had a look at Gobolinux and indeed,
it had the same "problem" (its only a problem if you, as user,
want to create dirs in that mounted target).

On Gobolinux they do another indirection, they do:
--> sysfs is mounted on /System/Kernel/Objects

And thus get away with having an IMHO better directory
structure. The fact still remains that you cant create
anything there hmm. Which means that I cant easily create
a /System directory there, as I will not be able to
manipulate it at all.
So I probably will use an indirection similar to how
Gobolinux does it as well.

Well, I guess my question is somehow solved

Last edited by shevegen; 01-23-2007 at 10:53 PM.
 
Old 01-24-2007, 03:52 PM   #6
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
You can't mount anything there because sysfs is inside the kernel. You can change the path by patching the kernel, but then any program that uses info from /sys will be lost. You might be able to use unionfs to remount it somewhere else and get pseudo read-write that way.
 
Old 01-24-2007, 07:50 PM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
What you are attempting to do now is not what you asked originally.
sysfs is a pseudo filesystem - a window into (some) kernel objects; a means of exposing data into userspace. Files within it will only be write-able from userspace if the (kernel/driver) code managing that file is smart enough to handle it - e.g. when you change sysctls by writing into /sys/whatever.
Put your data elsewhere.
 
  


Reply



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
/sys/devices/system/ Permission denied nsp Slackware 13 01-12-2007 07:14 AM
Is there a sys monitoring program that is helpful to detect why a system crashes? dr_zayus69 Linux - Software 3 12-10-2006 04:40 AM
Is a Linux sys w/o any passwd's as secure as a microsoft windows sys w/no passwd? t3gah Linux - Security 4 04-22-2005 08:01 PM
/sys eno_on Linux - General 2 01-09-2005 01:36 PM
Sys-unconfig retoon Solaris / OpenSolaris 5 06-25-2003 11:58 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:13 AM.

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
Open Source Consulting | Domain Registration