LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-06-2012, 02:07 PM   #1
galumph
LQ Newbie
 
Registered: Jan 2011
Distribution: Gentoo, Slackware 13
Posts: 6

Rep: Reputation: 3
Unionfs ro & rw combination


An old trick for space constrained systems is to compress /usr into a sqaushfs image and to mount it as read only somewhere, then mount it and a read write directory together in /usr using unionfs, aufs, etc.

In my installation, the usr image is mounted at /mnt/squashfs/ro and is then mounted together with /mnt/squashfs/rw at /usr, like so:
Code:
$ cat /etc/fstab | tail -n2
/mnt/squashfs/usr.img	/mnt/squashfs/ro	squashfs	loop,ro					0 0
usr			/usr			unionfs    	dirs=/mnt/squashfs/ro:/mnt/squashfs/rw	0 0
But whenever I try to create a file anywhere in /usr I'm told I can't because it is a read only file system. The read write dir contains exactly the same directories as the read only dir.

Is there a way to make unionfs write to the read write directory properly?

e, Apparently unoinfs prioritizes its directories according to their order in the dirs option. Thus fstab should be:
Code:
$ cat /etc/fstab | tail -n1
usr			/usr			unionfs    	dirs=/mnt/squashfs/rw:/mnt/squashfs/ro	0 0
Disregard this.

Last edited by galumph; 01-06-2012 at 02:17 PM. Reason: Found how to fix the problem
 
Old 01-06-2012, 02:25 PM   #2
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Hello,

Glad you found the answer already! Replying to take off of the zero reply list.

Cheers,

Josh
 
Old 01-06-2012, 02:27 PM   #3
galumph
LQ Newbie
 
Registered: Jan 2011
Distribution: Gentoo, Slackware 13
Posts: 6

Original Poster
Rep: Reputation: 3
Now that I think of it, this is in the wrong place. Can somebody please move this thread to the Linux - General section?
 
Old 01-06-2012, 02:37 PM   #4
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
I will report it to be moved for you.

Cheers,

Josh
 
Old 01-06-2012, 03:42 PM   #5
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Moved to Linux - General as requested.

@galumph: thanks for sharing the solution. Due to the presence of the keyword unionfs in the thread title, this may serve as a reference for anyone having the same problem and searching in the LQ database.

@corp769: thanks!
 
Old 01-06-2012, 04:27 PM   #6
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Quote:
Originally Posted by colucix View Post
Moved to Linux - General as requested.

@galumph: thanks for sharing the solution. Due to the presence of the keyword unionfs in the thread title, this may serve as a reference for anyone having the same problem and searching in the LQ database.

@corp769: thanks!
Anytime!
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bind Mouse Button Combination to Keyboard Key Combination? neoAKiRAz Linux - Desktop 0 05-04-2007 12:49 PM
Belkin Wireless Card & FC 6 - Not a good combination?? Ooberkev Fedora 1 03-08-2007 01:40 PM
unionfs CVS how to? android6011 Linux - General 1 01-29-2007 04:26 PM
unionfs Sayoji Linux - General 3 11-19-2006 04:34 PM
IM blocking with combination of IPtables & Squid shamza Linux - Security 1 09-29-2005 01:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:41 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