Page 2 of 6

Re: Auto Mount Partitions on Boot (also Windows partitions)

Posted: Tue Oct 06, 2009 9:02 am
by moshari
Hi all, it's been a while but other matters have kept me away from my learning curve.

I hope that someone is still watching this thread as unfortunately what I thought was fine & dandy is not quite right.

In short I have created a LV that using the basic instructions above works & auto mounts correctly with each & every boot but under the normal user I can only read the files / directories - NO Write access at all. If I use terminal and sudo su I can make changes as well to the LV but as normal user, feel free to look but don't touch.

I have done a fair bit of searching for answers but only have found little clues along the way. Below are the only 2 things that mounted the drive that worked for me but still no RW just R - fstab in /etc is what I have been editing of course.

/dev/akbtorrent/Torrents /home/alex/Downloads ext3 defaults,noatime 0 2
or
/dev/akbtorrent/Torrents /home/alex/Downloads ext3 rw,user,auto, 0 2
As I said both of these mount the drive but no W just R, if I remark out these I can change the /home/alex/downloads folder as much as I like but of coarse this is not changeing the LV at all. From what I had read previously I thought that I would have full RW because the mount point is owned by the user wthl full access except when this LV is mounted to the download folder.

Sorry not sure what other info would help or is needed for an answer.

Please help, the dent in my forehead is going to start bleeding soon.

Re: Auto Mount Partitions on Boot (also Windows partitions)

Posted: Tue Oct 06, 2009 11:47 pm
by moshari
Hi again,
I finally worked it out, I was concentrating on the /home/alex/Downloads folder and missing the point of ownership.
I used the following to resolve the issue
"sudo su"
"chown -R alex:alex /dev/akbtorrent/Torrents"
This solved the issue straight away no reboot needed.

More info on chown thanks to Fred http://forums.linuxmint.com/viewtopic.p ... al#p158834

Thanks to all for your fantastic past & future support, without you all guys like me would never see that flicker of light at the end of the tunnel. :D

Re: Auto Mount Partitions on Boot (also Windows partitions)

Posted: Sat Oct 31, 2009 8:44 pm
by David Hunter
Oh, Fred, I pray to thee to deliver me from my auto-mounting woes!
Lol, no but obviously we all have a great reverence for you, Fred.

I'm trying to mount an NTFS partition on my PC.
This works in fstab:

/dev/sda10 /home/david/Music ntfs defaults,umask=007,gid=46 0 0

But I'd like to get a folder inside that partition to mount into my Music folder. The folder on the partition is also called "Music".
So I tried

/dev/sda10/Music /home/david/Music ntfs defaults,umask=007,gid=46 0 0

But that didn't work. Do you know of a way of mounting that folder inside the /home/Music folder?

Thanks for the guide and help! :)

Re: Auto Mount Partitions on Boot (also Windows partitions)

Posted: Sun Nov 01, 2009 9:24 am
by Fred
David Hunter,

There are several ways to go about this but the easiest to understand would probably be to mount sda10, as sda10, in /media instead of your home.

Then create a symlink in your home called Music that points to the Music folder on sda10.

I am going to assume you now know how to mount sda10 in /media, and have done so. Then in a terminal:

cd /home/david

......... .......... target ........... symlink
ln -sf /media/sda10/Music Music

If you have a problem accessing your music, which you probably will, run the ownership command below.

sudo su

chown -R david:david /media/sda10/Music

I hope this has been helpful. If I confused you post back.

Fred

Re: Auto Mount Partitions on Boot (also Windows partitions)

Posted: Sun Nov 01, 2009 9:45 am
by altair4
Fred, could you also do something like this in fstab?

/dev/sda10 /media/sda10 ntfs defaults,umask=007,gid=46 0 0
/media/sda10/Music /home/david/Music auto bind 0 0

Making sure that the the second line, which is "Music" specific, follows the first line, which is device specific, in fstab.

Or have I not thought something through :?:

Re: Auto Mount Partitions on Boot (also Windows partitions)

Posted: Sun Nov 01, 2009 10:11 am
by Fred
altair4,

I don't see any reason right off the top of my head why this shouldn't work. The only question that occurs to me would be related to NTFS-3g, as that is what we are actually using to recognize and manipulate this partition.

I don't have or use any NTFS file systems so I can't easily test it. Try it and see, if you have a NTFS partition. Post back your results. I would be interested in the outcome. Good question. :-)

Fred

Re: Auto Mount Partitions on Boot (also Windows partitions)

Posted: Sun Nov 01, 2009 10:36 am
by altair4
After "shooting from the hip" in earlier posts I did test it on an ntfs partition then mounted it using a "mount -a" before posting. I just now did a reboot to make sure there wasn't a timing issue and it appears to work:

Using the example in my post /home/david/Music is mounted as owner:group = david:plugdev with read/write access to both. It follows the permissions set in the previous mount of the sda10 partition in media.

I just didn't know if there where any repercussions in doing something like this because I only remember doing this a while ago and I'm becoming old and feeble minded :lol:

EDIT: I told you I was getting feeble minded :wink: . The owner:group was root:plugdev with read/write access to both owner and group and "david" is a member of the plugdev group.

Re: Auto Mount Partitions on Boot (also Windows partitions)

Posted: Sun Nov 01, 2009 5:52 pm
by Fred
altair4,

I don't remember teaching you anything about binding. You have been doing some reading on your own. Good for you. :-)

Keep it up and you will become my go-to person when I get in trouble. :-)

Fred

Re: Auto Mount Partitions on Boot (also Windows partitions)

Posted: Sun Nov 01, 2009 6:30 pm
by altair4
Fred wrote:altair4,
I don't remember teaching you anything about binding. You have been doing some reading on your own. Good for you. :-)
Keep it up and you will become my go-to person when I get in trouble. :-)
Fred
I doubt that will ever happen. But like I keep trying to tell my wife, I'm more than just a pretty face :lol:

Re: Auto Mount Partitions on Boot (also Windows partitions)

Posted: Sun Nov 01, 2009 6:41 pm
by Fred
altair4 wrote:
But like I keep trying to tell my wife, I'm more than just a pretty face :lol:
I made the mistake of telling my wife that one time too. She laughed hysterically for about an hour, then stopped to think about it for a min. and started to cry. :-)

Fred

Re: Auto Mount Partitions on Boot (also Windows partitions)

Posted: Sun Nov 01, 2009 7:07 pm
by David Hunter
Fred wrote:altair4 wrote:
But like I keep trying to tell my wife, I'm more than just a pretty face :lol:
I made the mistake of telling my wife that one time too. She laughed hysterically for about an hour, then stopped to think about it for a min. and started to cry. :-)

Fred
lol. I'm too young to have a wife, so I don't have to worry about that sort of thing... yet.

Just tried Altair's idea... directly copied from his post:

/dev/sda10 /media/local ntfs defaults,umask=007,gid=46 0 0
/media/sda10/Music /home/david/Music auto bind 0 0

into fstab. Upon rebooting, partition doesn't mount and when I go to do so manually I get an error message saying that I don't have permissions to mount the partition (and because it's not mounted, I can't run Fred's chown command)...

I'm about to try

/dev/sda10 /media/local ntfs defaults,umask=007,gid=46 0 0

and then the symlink, then I'll reboot and let you know how it goes.. but I saw you two are online and chatting now, so figured I'd post a reply now.

Thanks for your help.

Re: Auto Mount Partitions on Boot (also Windows partitions)

Posted: Sun Nov 01, 2009 7:16 pm
by David Hunter
OK just tried

/dev/sda10 /media/local ntfs defaults,umask=007,gid=46 0 0

and I'm still getting no auto-mount and the mount permissions error.
(Note my use of /media/local instead of /sda10 - merely for aesthetic purposes...). Do I need to make a folder called "local" (or "sda10") inside the media folder first for this to work?

(Going to try that now and reboot).

Re: Auto Mount Partitions on Boot (also Windows partitions)

Posted: Sun Nov 01, 2009 7:20 pm
by David Hunter
OK silly me, making the folder makes it work now. :)
Going to try altair's 2nd line now in fstab.

Re: Auto Mount Partitions on Boot (also Windows partitions)

Posted: Sun Nov 01, 2009 7:22 pm
by Fred
David Hunter,

Did you create a folder in /media called local first? You always need a folder that exists in the file system before you can mount anything to it. Go back and re-read my first post at the beginning of the thread.

EDIT: ok... I see you found it while I was posting. :-)

Fred

Re: Auto Mount Partitions on Boot (also Windows partitions)

Posted: Sun Nov 01, 2009 7:34 pm
by David Hunter
Fred wrote:David Hunter,

Did you create a folder in /media called local first? You always need a folder that exists in the file system before you can mount anything to it. Go back and re-read my first post at the beginning of the thread.

EDIT: ok... I see you found it while I was posting. :-)

Fred
Looks like we had the same thought at the same time.
Yep, all's working perfectly now.
Thanks Fred and altair for your help. :D

Re: Auto Mount Partitions on Boot (also Windows partitions)

Posted: Sat Nov 21, 2009 9:10 am
by austin.texas
very interesting discussion. Thanks for your tips, Fred.
In reference to the use of UUID in fstab, I ran into an little problem with that. I used GParted to copy my Mint partition, sda1, to a backup drive, sdb1.
I discovered that GParted had copied the UUID for sda1, and now sda1 and sdb1 both had the same UUID and were both mounted at /
I had to generate a new UUID for sdb1,

Code: Select all

tune2fs -U time /dev/sdb1
and create a new mount point, and then everything was fine. I could boot into either hard drive, after editing the grub menu.
So I think sticking with the old /dev/sdb1 convention is preferable to UUID or labels.

Re: Auto Mount Partitions on Boot (also Windows partitions)

Posted: Sat Nov 21, 2009 9:16 am
by altair4
Could have used labels ( LABEL=) instead of UUID or /dev/sdxy as well. I had the same situation. I made a clone of an NTFS partition and had duplicate UUID's. I prefer labels because the probability of duplicate labels is somewhat remote being that the user is in control of the label. But in my case you never know..... :lol:

Re: Auto Mount Partitions on Boot (also Windows partitions)

Posted: Thu Dec 24, 2009 7:29 am
by Sjonnie
I dont see what I am doing wrong.

I did the terminal command:

sudo blkid
[sudo] password for xxxxx:
/dev/sda1: UUID="d205554f-e78e-4cfd-a532-17de3c820563" TYPE="swap"
/dev/sda5: LABEL="Linux" UUID="c0f8cae5-6d35-49af-a71f-227a45be085f" TYPE="ext3"
/dev/sda6: LABEL="Media" UUID="219042da-6549-4689-b911-bb7445e25b49" SEC_TYPE="ext2" TYPE="ext3"
/dev/sda7: LABEL="Backup" UUID="a26a953a-adfa-40e4-affb-842ce82d50dd" SEC_TYPE="ext2" TYPE="ext3"
/dev/sdb1: LABEL="2 Downloads" UUID="b564f133-26e6-4ba0-a77d-88181721ce99" SEC_TYPE="ext2" TYPE="ext3"
/dev/sdb2: LABEL="2 Downloads 2" UUID="26710503-d6f1-44a6-83bc-de112317451f" SEC_TYPE="ext2" TYPE="ext3"

/dev/sdb3: UUID="b3365a4a-7991-4d95-8d96-873a48226f36" TYPE="swap"
(bolded parts are the partitions I want to automount)


And added the following line to the etc/fstab: #/dev/219042da-6549-4689-b911-bb7445e25b49 /media/Media ext3 defaults,noatime 0 2
This was to moun the "Media" labeled partitation. But it didnt work.

This is everything I have done, I dont really understand the first part of the guide (mounted folder part) of the guide tho. What else do I need to do. I am totally new to linux, so the guide was kinda hard to read.

Re: Auto Mount Partitions on Boot (also Windows partitions)

Posted: Thu Dec 24, 2009 7:51 am
by altair4
I'll admit it's kind of confusing since blkid reports things with ( " ) around things and fstab does not. You've got 3 choices:

UUID=219042da-6549-4689-b911-bb7445e25b49 /media/Media ext3 defaults,noatime 0 2

/dev/sda6 /media/Media ext3 defaults,noatime 0 2

LABEL=Media /media/Media ext3 defaults,noatime 0 2

But you have to have the /media/Media mount point created first.
sudo mkdir /media/Media

Re: Auto Mount Partitions on Boot (also Windows partitions)

Posted: Thu Dec 24, 2009 8:34 am
by Sjonnie
altair4 wrote:I'll admit it's kind of confusing since blkid reports things with ( " ) around things and fstab does not. You've got 3 choices:

UUID=219042da-6549-4689-b911-bb7445e25b49 /media/Media ext3 defaults,noatime 0 2

/dev/sda6 /media/Media ext3 defaults,noatime 0 2

LABEL=Media /media/Media ext3 defaults,noatime 0 2

But you have to have the /media/Media mount point created first.
sudo mkdir /media/Media
~ $ sudo mkdir /media/Media
mkdir: cannot create directory `/media/Media': File exists
dpham@dpham-desktop ~ $

Doesnt work.
I also tried to make a new dir, "/media/Media/test". A new folder is then created, but I still cant automount my partitions.