LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-28-2015, 11:57 PM   #1
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Anything in Slackware to Virtually Merge Two Folders?


As the title states, I am looking to virtually merge two folders into one. These folders are extremely large and reside on separate drives (one is 1.4TB and the other is 2.7TB). I still plan to use the normal mount points for file and folder manipulation, but I want to combine them somewhere in a read-only status for display on my website (I set up windex as a fancy directory listing). There will be no duplicate names or folders in the merged folder. I have no desire to do raid or LVM with these drives and prefer to keep them physically separate.

Basically, I am working on setting up a basic listing of all my media content that is hosted for my htpc, but make it available to me to easily stream via my phone or laptop. I have everything already set up and it seems to work fine, but I want to do more pruning on the way things are listed. Currently all my ripped movies are on one drive and I have split my TV shows into two drives, one for ongoing series that I have ripped, and the other for series that have ended/been cancelled. I want to combine both the TV show folders into one folder that is displayed on the site. The drives are currently set up as:

Code:
/share/
|--TV/
|  |--completed/      #/dev/sdb1
|  |  |--TV Shows/
|  |  |  |--3rd Rock from the Sun/
|  |  |  |--Firefly/
|  |  |  `--Smallville/
|  |  `--Random1             # Won't be included in the webshare
|  |
|  `--ongoing/        #/dev/sdc1
|     |--TV Shows/
|     |  |--Castle (2009)/
|     |  |--Mythbusters/
|     |  `--The Newsroom/
|     `--Random2             # Won't be included in the webshare
|
`--movies/            #/dev/sdd1
   |--Movies/
   |  |--Galaxy Quest/
   |  `--Short Circuit/
   `--Random3/               # Won't be included in the webshare
What I want it to be is:

Code:
website.com/
|--TV Shows/
|  |--3rd Rock from the Sun/
|  |--Castle (2009)/
|  |--Firefly/
|  |--Mythbusters/
|  |--Smallville/
|  `--The Newsroom/
|
`--Movies/
   |--Galaxy Quest/
   `--Short Circuit/
It's easy enough to just do a symlink for Movies/ in the folder I share, but what can I do for the TV shows? I've read about using cp -s (or -l) to make symlinks (or hardlinks) for all the files and folders, but this is something I'd have to run anytime I make changes to the filesystem, which I'd rather not deal with (even though I could semi-automate it with a script). Is there something that comes with Slackware that is able to do what I'm looking for?

I've read a bit about unionfs, mhddfs, and aufs, but they seem to tackle something much greater than I need (it seems all of them support writing to those directories, of which, I won't be doing as I'd access the direct location of the files whenever I make changes). However, if any of these are the best route to go, is there a suggestion on which one is best and if there's any slackbuilds available (aufs was available on slackbuilds.org back with 12.1 and I can probably use that as a starting point)?

Keep in mind, the folders under website.com will be read-only (and the website is password protected), so there is no reason to use a tool that allows read/write, unless that's the only tool available.

Thanks in advance for any insight on the matter.
 
Old 01-29-2015, 06:22 AM   #2
ivandi
Member
 
Registered: Jul 2009
Location: Québec, Canada
Distribution: CRUX, Debian
Posts: 528

Rep: Reputation: 866Reputation: 866Reputation: 866Reputation: 866Reputation: 866Reputation: 866Reputation: 866
May be https://github.com/rpodgorny/unionfs-fuse

Cheers
 
Old 01-29-2015, 07:19 AM   #3
55020
Senior Member
 
Registered: Sep 2009
Location: Yorks. W.R. 167397
Distribution: Slackware
Posts: 1,307
Blog Entries: 4

Rep: Reputation: Disabled
overlayfs is possibly a better choice than unionfs-fuse: it is included as standard in kernel 3.18 onwards, and the config for 3.18.1 is now in -current (see testing/source/config-testing-3.18.1/).

Otherwise you could use XStow (available from SlackBuilds.org) which will create and maintain a merged symlink tree for you. Despite the name XStow is not a gui application.
It works the same as Gnu Stow and there are lots of Gnu Stow tutorials on the net.
 
2 members found this post helpful.
Old 01-29-2015, 08:42 AM   #4
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Original Poster
Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Quote:
Originally Posted by 55020 View Post
overlayfs is possibly a better choice than unionfs-fuse: it is included as standard in kernel 3.18 onwards, and the config for 3.18.1 is now in -current (see testing/source/config-testing-3.18.1/).
Beautiful! I'm already running 3.18.0 (probably should upgrade to a newer one utilizing Pat's config instead of my own), so I'll have to give this a shot when I get home. Seems like I can just do the following:

Code:
mount -t overlayfs -o lowerdir=/share/TV/ongoing/TV\ Shows,upperdir=/share/TV/completed/TV\ Shows /var/www/httpd/share/TV
I'll dig into this more when I get home. Thanks again!
 
Old 01-29-2015, 09:10 AM   #5
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Original Poster
Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Bummer... long story short, apparently I compiled my kernel without overlayfs

I figured I'd try mounting everything from my phone (JuiceSSH is an AMAZING program and blows other Android SSH apps out of the water). I kept running into syntax issues with my command, so I did more digging and realized, after looking at my .config, that I left CONFIG_OVERLAY_FS as not set. While I can start a kernel compile from my phone using screen (in case I get disconnected, I don't wouldn't want the compile to fail), I think I'll just wait until I get home and load up Pat's config (I already checked and he has enabled overlayfs) and probably give 3.18.4 a go.

Hopefully I'll get this up and running tonight, but my computer isn't as fast as it used to be...
 
Old 01-29-2015, 07:01 PM   #6
ivandi
Member
 
Registered: Jul 2009
Location: Québec, Canada
Distribution: CRUX, Debian
Posts: 528

Rep: Reputation: 866Reputation: 866Reputation: 866Reputation: 866Reputation: 866Reputation: 866Reputation: 866
Quote:
Originally Posted by 55020 View Post
overlayfs is possibly a better choice than unionfs-fuse: it is included as standard in kernel 3.18 onwards, and the config for 3.18.1 is now in -current (see testing/source/config-testing-3.18.1/).
Oh, I missed it. Thanks for pointing it out.


Cheers
 
  


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
Slackware to merge with Ubuntu? ottavio Slackware 21 04-01-2013 03:04 PM
merge contents of folders minimole Linux - Newbie 5 05-25-2007 05:46 AM
Virtually moving IMAP Folders from mail/ to root level fishsponge Linux - Software 0 06-21-2005 04:53 AM
merge two folders TechNett Programming 1 05-02-2005 08:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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