LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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-10-2009, 06:40 PM   #1
mslootweg
LQ Newbie
 
Registered: Oct 2009
Posts: 2

Rep: Reputation: 0
Access file after FS mounted on parent folder


I've set up debian to run in a read only envoirement. /var and /etc are ram drives. The way I do this is to run a boot script right after the usual boot mounting that mounts a ram disk(tmpfs specifically) on /etc and /var. I then mount the root partition a second time on /mnt/sda1 and copy over the contents from /mnt/sda1/etc to /etc and the contents from /mnt/sda1/var to /var. My problem is that mounting the same device twice has unpredictable results. Sometimes it works, sometimes it returns "mount: /dev/sda1 already mounted or /dev/sda1 busy"

I'm thinking the best way of fixing this issue is to not mount the root filesystem a second time, it's an ugly solution anyway. Is there anyway to access /etc on the device /dev/sda1 after a ram disk has been mounted on /etc?
 
Old 10-11-2009, 11:17 AM   #2
penguiniator
Member
 
Registered: Feb 2004
Location: Olympia, WA
Distribution: SolydK
Posts: 442
Blog Entries: 3

Rep: Reputation: 60
I'm assuming /etc is in a separate partition? You could create a different mount point for it and use that instead.
 
Old 10-12-2009, 06:28 AM   #3
mslootweg
LQ Newbie
 
Registered: Oct 2009
Posts: 2

Original Poster
Rep: Reputation: 0
Unfortunatly I haven't found a way to get /etc off the root partition. this is because the debian boot sequence reads /etc/fstab to know where specific mounts are located. It can't read in /etc/fstab if the location of /etc isn't known yet.

So my full debian install is on one giant root partition all together, some directories are then replaced by ramdrives and filled by the files that were in those directories.

But after mounting a ramdrive on /var I can't find a way to get to the original files that are on the harddrive in /var without unmounting the ramdrive first, which would destroy the ramdrive.
 
  


Reply

Tags
debian, mount, readonly



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
Apache access to mounted folder pancakes Linux - Server 2 04-13-2009 12:53 PM
File descriptors shared between child and parent causing parent to hang. bharadiaam Linux - Newbie 1 03-02-2009 01:01 AM
Unrar and Rename to Parent Folder Recursively Vasto Linux - Newbie 9 10-16-2008 06:36 AM
automatically inherit parent folder permissions when copying files teixeira Linux - Newbie 3 07-08-2008 12:21 PM
How can I change the access permissions of a file or folder? royeo Linux - Newbie 1 07-25-2006 03:36 PM

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

All times are GMT -5. The time now is 03:01 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
Open Source Consulting | Domain Registration