LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Mount storage partition folders to home folders (https://www.linuxquestions.org/questions/linux-newbie-8/mount-storage-partition-folders-to-home-folders-836651/)

skykooler 10-06-2010 07:49 PM

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?

captainhardway 10-06-2010 08:23 PM

Quote:

Originally Posted by skykooler (Post 4119982)
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.

skykooler 10-06-2010 09:28 PM

It is a FAT32 partition.
How do I set it up with fstab?

captainhardway 10-07-2010 01:31 PM

Quote:

Originally Posted by skykooler (Post 4120033)
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.

skykooler 10-07-2010 10:56 PM

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



All times are GMT -5. The time now is 01:59 AM.