LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 10-06-2010, 07:49 PM   #1
skykooler
Member
 
Registered: Feb 2010
Distribution: Ubuntu
Posts: 84

Rep: Reputation: 17
Mount storage partition folders to home folders


I have a storage partition with four folders on it named "All (universal)", "Windows", "Mac", and "Linux". In my "All (universal)" folder I have three folders, labeled "Pictures", "Documents" and "Videos". In my "Linux" folder I have a folder labeled "Downloads". I would like to mount these folders to my Pictures, Documents, Videos and Downloads folders. I wrote an /etc/init.d script to do this on boot but for some reason they end up mounted as read-only. Here is the script:
Code:
#! /bin/sh

mkdir /media/Storage
mount /dev/sda7 /media/Storage
mount --bind /media/Storage/Linux/Downloads/ /home/skyler/Downloads
mount --bind /media/Storage/All\ \(universal\)/Documents/ /home/skyler/Documents
mount --bind /media/Storage/All\ \(universal\)/Pictures/ /home/skyler/Pictures
mount --bind /media/Storage/All\ \(universal\)/Videos/ /home/skyler/Videos

chown -R skyler:skyler /home/skyler/Downloads
chown -R skyler:skyler /home/skyler/Documents
chown -R skyler:skyler /home/skyler/Pictures
chown -R skyler:skyler /home/skyler/Videos
chown -R skyler:skyler /home/skyler
What am I doing wrong?
 
Old 10-06-2010, 08:23 PM   #2
captainhardway
LQ Newbie
 
Registered: Oct 2010
Distribution: Slackware
Posts: 16

Rep: Reputation: 1
Quote:
Originally Posted by skykooler View Post
I have a storage partition with four folders on it named "All (universal)", "Windows", "Mac", and "Linux". In my "All (universal)" folder I have three folders, labeled "Pictures", "Documents" and "Videos". In my "Linux" folder I have a folder labeled "Downloads". I would like to mount these folders to my Pictures, Documents, Videos and Downloads folders. I wrote an /etc/init.d script to do this on boot but for some reason they end up mounted as read-only. Here is the script:
Code:
#! /bin/sh

mkdir /media/Storage
mount /dev/sda7 /media/Storage
mount --bind /media/Storage/Linux/Downloads/ /home/skyler/Downloads
mount --bind /media/Storage/All\ \(universal\)/Documents/ /home/skyler/Documents
mount --bind /media/Storage/All\ \(universal\)/Pictures/ /home/skyler/Pictures
mount --bind /media/Storage/All\ \(universal\)/Videos/ /home/skyler/Videos

chown -R skyler:skyler /home/skyler/Downloads
chown -R skyler:skyler /home/skyler/Documents
chown -R skyler:skyler /home/skyler/Pictures
chown -R skyler:skyler /home/skyler/Videos
chown -R skyler:skyler /home/skyler
What am I doing wrong?

Greetings

If the stoarge disk is in NTFS then this may be a umask 022 problem that would give root full access.

I initially mount the whole NTFS partition or drive in fstab then mount the binds as you did, and that helped me when I included the umask in the fstab line such as this for an example.

/dev/sdc1 /FreeAgent ntfs-3g defaults,umask=002,locale=en_US.utf8 0 0

I also notice that you are trying to change ownership to a user. File permissions are not as manageable if they are NTFS, a umask of 000 would enable basically a chmod 777. I am still learning the jedi arts on a daily basis, and perhaps a master would have a better solution for you with your given information.

I hope this helps you.

Last edited by captainhardway; 10-06-2010 at 08:28 PM.
 
Old 10-06-2010, 09:28 PM   #3
skykooler
Member
 
Registered: Feb 2010
Distribution: Ubuntu
Posts: 84

Original Poster
Rep: Reputation: 17
It is a FAT32 partition.
How do I set it up with fstab?
 
Old 10-07-2010, 01:31 PM   #4
captainhardway
LQ Newbie
 
Registered: Oct 2010
Distribution: Slackware
Posts: 16

Rep: Reputation: 1
Quote:
Originally Posted by skykooler View Post
It is a FAT32 partition.
How do I set it up with fstab?
Greetings again

/dev/sdc1 /FreeAgent vfat users,exec,umask=0 0

is an example I have seen for fat partitions. Although I do not use them anymore I cannot verify this will work the way you intended but it should. Let me know if this works please so I can add it to my list of solutions. Best regards.
 
Old 10-07-2010, 10:56 PM   #5
skykooler
Member
 
Registered: Feb 2010
Distribution: Ubuntu
Posts: 84

Original Poster
Rep: Reputation: 17
It is not working. Now the folders aren't getting mounted at all. This is my fstab:
Code:
# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    nodev,noexec,nosuid 0       0
# / was on /dev/sda8 during installation
UUID=72cee58b-0a00-44f3-bdf3-9bb35b2564fe /               ext3    errors=remount-ro 0       1
# swap was on /dev/sda5 during installation
UUID=6319d513-93a4-4b04-ad71-03f1ce48f485 none            swap    sw              0       0

/dev/sda7 /mnt/Storage vfat users,exec,umask=0 0
And here is my /etc/init.d script. Again, if I run these commands from terminal, everything works.

Code:
#! /bin/sh

mount --bind /mnt/Storage/Linux/Downloads/ /home/skyler/Downloads
mount --bind /mnt/Storage/All\ \(universal\)/Documents/ /home/skyler/Documents
mount --bind /mnt/Storage/All\ \(universal\)/Pictures/ /home/skyler/Pictures
mount --bind /mnt/Storage/All\ \(universal\)/Videos/ /home/skyler/Videos
 
  


Reply


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
bash script to create folders including making recursive folders.... linux-bandit Linux - Software 8 11-28-2009 01:50 AM
find -exec command to recursively delete files and folders in folders with X name Joan Murt Linux - Newbie 2 07-08-2009 04:35 PM
Can I mount two folders to one partition? gckaibab Linux - Newbie 11 03-20-2006 10:35 PM
Samba can create new files and folders but access denied in any new folders k.king Linux - Networking 2 01-15-2006 06:14 AM
Why Two Home Folders? pheonix Linux - Newbie 8 02-16-2004 10:36 PM


All times are GMT -5. The time now is 01:21 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration