Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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.
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.
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.
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.