You are not logged in.

#1 2012-11-19 08:08:39

nwenclaff
Member
Registered: 2012-11-19
Posts: 5

I just want to unionfs 2 drives together

I would like to run the following code automatically without me having to do anything:
-------------------------------
sudo unionfs -o cow -o allow_other /media/Media/Vids/Secondary=rw:/media/Media/Vids/Primary=rw /media/Combined

sudo unionfs -o cow -o allow_other /media/Combined=rw:/media/Media/Vids/Local=rw /media/Vids
-----------------------------------
However I keep running into pitfalls

I tried to do a system command file launched with a .service file
the bash file resides at /usr/bin/unionfsscript
---------------------------------------------
#!/bin/sh
unionfs -o cow -o allow_other /media/Media/Vids/Secondary=rw:/media/Media/Vids/Primary=rw /media/Combined
unionfs -o cow -o allow_other /media/Combined=rw:/media/Media/Vids/Local=rw /media/Vids
---------------------------------------------------
which I did a chmod +x afterwards to the file

Then I wrote /etc/systemd/system/unionfsservice.service

[Unit]
Description=Load All Network Drives

[Service]
Type=oneshot
ExecStart=/usr/bin/unionfsscript

[Install]
WantedBy=multi-user.target

----------------------

Afterwhich I ran systemctl enable unionfsservice.service
Then I ran systemctl start unionfsservice.service
-Did nothing

Afterwhich I ran:

--------------
systemctl status unionfsservice.service
----------------------

and got:

--------------------
unionfsservice.service - Load All Network Drives
          Loaded: loaded (/etc/systemd/system/unionfsservice.service; enabled)
          Active: failed (Result: exit-code) since Sun, 2012-11-18 22:58:51 EST; 9s ago
         Process: 1320 ExecStart=/usr/bin/unionfsscript (code=exited, status=1/FAILURE)
          CGroup: name=systemd:/system/unionfsservice.service

Nov 18 22:58:51 archlinux-voncloft systemd[1]
Nov 18 22:58:51 archlinux-voncloft unionfsscript[1320]
Nov 18 22:58:51 archlinux-voncloft unionfsscript[1320]
Nov 18 22:58:51 archlinux-voncloft unionfsscript[1320]
Nov 18 22:58:51 archlinux-voncloft unionfsscript[1320]
Nov 18 22:58:51 archlinux-voncloft systemd[1]
Nov 18 22:58:51 archlinux-voncloft systemd[1]
Nov 18 22:58:51 archlinux-voncloft systemd[1]

----------------------

I tried running the /usr/bin file as a startup script.........even tried putting sudo in the file - NOTHING IS WORKING

I tried doing a /etc/fstab with the following

unionfs  /media/Combined unionfs dirs=/media/Media/Vids/Primary=rw:/media/Media/Vids/Secondary=rw -o allow_other    0 0

which kind of worked.....it would mount the drive but I couldn't view the contents unless I did sudo /media/Comined in a terminal. and if I put allow_other right after the 2nd unionfs it made no difference, I can't use a -o flag either.

Any ideas I am going crazy over this...I just want to merge the folders together into one folder when the pc boots up

I was able to do so in a rc.local file....but since Arch moved to a forsaken systemd structure (which is a horrible idea in my opinion) that idea has been crushed.

any help please

Offline

#2 2012-11-19 08:14:06

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: I just want to unionfs 2 drives together

Can you confirm that your log is really showing log entries with no content?

Offline

#3 2012-11-19 08:15:07

nwenclaff
Member
Registered: 2012-11-19
Posts: 5

Re: I just want to unionfs 2 drives together

which log would this be?

Offline

#4 2012-11-19 09:44:11

hunterthomson
Member
Registered: 2008-06-22
Posts: 794
Website

Re: I just want to unionfs 2 drives together

Well, with the fstab part. /etc/fstab is run as root, so all the dir's will be owned by root by defualt.

You would need to add like these to the mount options in fstab

uid=1000,gid=100

Like here is my Downloads directory fstab entry that I mount as a tempfs

tmpfs           /home/user/Downloads    tmpfs   rw,nodev,noatime,noexec,nosuid,uid=1000,gid=100,mode=700,size=10G 0 0

Last edited by hunterthomson (2012-11-19 09:45:30)


OpenBSD-current Thinkpad X230, i7-3520M, 16GB CL9 Kingston, Samsung 830 256GB
Contributor: linux-grsec

Offline

Board footer

Powered by FluxBB