LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-27-2015, 12:28 AM   #1
rajendrabani
LQ Newbie
 
Registered: Mar 2015
Posts: 12

Rep: Reputation: Disabled
Not able to access device node in chroot


I have mounted ramdisk using mount and chroot commands. But I don't see any device nodes, e.g. USB key in /dev/sda1 or NAND paritions in /dev/mtd2, etc.

My questions are:
- Does chroot runs init script when it is mounted? Or this has to be done manually?
- How to access devices from chroot?
- If regular file system is accessing this node, does this gets locked?
- If regular file system is RO, can I mount filesystem with RW?
 
Old 10-27-2015, 03:41 AM   #2
lambo69
Member
 
Registered: Sep 2012
Distribution: Slackware, Manjaro, Slackarm, Raspbian, Debian
Posts: 57

Rep: Reputation: Disabled
Quote:
Does chroot runs init script when it is mounted?
No

Quote:
Or this has to be done manually?
Yes

Quote:
How to access devices from chroot?
Before you enter the chrooted directory, you have to mount /dev into it with --bind switch.
Code:
mount --bind /dev /chroot/dev
If you need further access, mounting /sys and /proc in the same way was not a bad idea.

Last edited by lambo69; 10-27-2015 at 03:43 AM.
 
1 members found this post helpful.
Old 10-27-2015, 09:20 AM   #3
rajendrabani
LQ Newbie
 
Registered: Mar 2015
Posts: 12

Original Poster
Rep: Reputation: Disabled
Hi Lambo69,

Your suggestion to bind worked for me. Thanks for your help!

regards
Rajendra
 
Old 10-27-2015, 09:26 AM   #4
lambo69
Member
 
Registered: Sep 2012
Distribution: Slackware, Manjaro, Slackarm, Raspbian, Debian
Posts: 57

Rep: Reputation: Disabled
You're welcome

Last edited by lambo69; 10-27-2015 at 09:27 AM.
 
  


Reply

Tags
chroot


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
How to access i2c device driver node farrukh_arshad Linux - Kernel 7 12-19-2012 10:05 PM
[SOLVED] How to specfiy the some device node name to physical device(CF memory) poplinux Linux - General 2 11-13-2012 01:14 AM
Device node access permissions in Linux ramonfried Linux - Kernel 1 08-28-2011 04:34 AM
Creating A New Device Node/Not A Valid Block Device indienick Debian 4 07-13-2007 02:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:26 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration