Auto Mount Partitions on Boot (also Windows partitions)

Write tutorials here
There are more tutorials here http://community.linuxmint.com/tutorial/welcome
Forum rules
Please don't add support questions to tutorials,start your own thread in the appropriate sub-forum instead. Before you post please read this
altair4
Level 20
Level 20
Posts: 10212
Joined: Tue Feb 03, 2009 10:27 am

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

Post by altair4 »

OK, it looks like you already created the /media/Media mount point.

Go into /etc/fstab and change:
#/dev/219042da-6549-4689-b911-bb7445e25b49 /media/Media ext3 defaults,noatime 0 2
to this:
/dev/sda6 /media/Media ext3 defaults,noatime 0 2
To get to fstab as root:

Press Alt+F2 ( press the Alt anf F2 keys at the same time )
Type gksu gedit /etc/fstab

Save the file. You can do this without rebooting but I'm not sure what you have mounted at the moment so just do a reboot.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
Sjonnie
Level 1
Level 1
Posts: 11
Joined: Mon Dec 21, 2009 5:34 pm

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

Post by Sjonnie »

altair4 wrote:OK, it looks like you already created the /media/Media mount point.

Go into /etc/fstab and change:
#/dev/219042da-6549-4689-b911-bb7445e25b49 /media/Media ext3 defaults,noatime 0 2
to this:
/dev/sda6 /media/Media ext3 defaults,noatime 0 2
To get to fstab as root:

Press Alt+F2 ( press the Alt anf F2 keys at the same time )
Type gksu gedit /etc/fstab

Save the file. You can do this without rebooting but I'm not sure what you have mounted at the moment so just do a reboot.
edit: Ok it works now, except for "2 Downloads", and "2 Downloads 2 partition".
this is what I have added:
/dev/sda6 /media/Media ext3 defaults,noatime 0 2
/dev/sda7 /media/Backup ext3 defaults,noatime 0 2
/dev/sda1 "/media/2 Downloads" ext3 defaults,noatime 0 2 <------ doesnt work (wont work without the " " either)
/dev/sda2 "/media/2 Downloads 2" ext3 defaults,noatime 0 2 <------ doesnt work (wont work without the " " either)

[bullocks]
Damn, this was more than I bargained for.

At first it worked. But "2 Downloads" and "2 Downloads 2" still would not automount. I thought, it must be because of the "spaces" in the partition lable. I tried a few things (like putting " " between the labels in the fstab), it didnt work. So I just removed the lines and called it a day. Well... It seems that didnt do it, now I cant automount ANY partitions at all. So I decided to return the fstab to its default state. This didnt work either, I can now mount (just mount, not automount) every drive, except for media/Media... ???

What is happening? Also, on startup, b4 my computer "goes into the OS", I see the usual Mintlogo, but now under the logo I see a bunch of texts saying its checking for my partitions... This never happened before.

o_O[/bullocks]
altair4
Level 20
Level 20
Posts: 10212
Joined: Tue Feb 03, 2009 10:27 am

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

Post by altair4 »

Change:
/dev/sda2 "/media/2 Downloads 2" ext3 defaults,noatime 0 2
To :
/dev/sda2 /media/2\040Downloads\0402 ext3 defaults,noatime 0 2
Get rid of all the quotes (") and substitute \040 for the spaces in the mount point.

Linux hates spaces!

Once again either reboot or
Open Terminal
Type sudo mount -a

EDIT: Sorry didn't read to the end of your post:
What is happening? Also, on startup, b4 my computer "goes into the OS", I see the usual Mintlogo, but now under the logo I see a bunch of texts saying its checking for my partitions... This never happened before.
That's normal, that's what you want an OS to do. It's just making a normal filesystem check to make sure everything is OK.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 20
Level 20
Posts: 10212
Joined: Tue Feb 03, 2009 10:27 am

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

Post by altair4 »

(1) At this point it might be best to just post your entire fstab so we can see what's up

Open Terminal
Type cat /etc/fstab

(2) Fred, I do apologize for interceding on this issue. This is after all your topic and I'm a poor substitute for you :oops: Given the date and your avatar I just assumed you where too busy with "the list" and Rudolph. :wink:
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
Sjonnie
Level 1
Level 1
Posts: 11
Joined: Mon Dec 21, 2009 5:34 pm

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

Post by Sjonnie »

# /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 defaults 0 0
# / was on /dev/sda5 during installation
UUID=c0f8cae5-6d35-49af-a71f-227a45be085f / ext3 errors=remount-ro 0 1
# swap was on /dev/sda1 during installation
UUID=d205554f-e78e-4cfd-a532-17de3c820563 none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
/dev/sda6 /media/Media ext3 defaults,noatime 0 2
/dev/sda7 /media/Backup ext3 defaults,noatime 0 2
/dev/sda1 /media/2\040Downloads ext3 defaults,noatime 0 2
/dev/sda2 /media/2\040Downloads\0402 ext3 defaults,noatime 0 2

Doesnt work either.

I am thinking about changing my partition label to one without spaces with Gparted (only accessible with the live CD if I am right).
I always use underscore for filenames instead of spaces, dunno why I decided to use spaces this time -_-

Thx for all the help so far.
altair4
Level 20
Level 20
Posts: 10212
Joined: Tue Feb 03, 2009 10:27 am

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

Post by altair4 »

I think I found it. From blkid:
/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"
Your fstab states:
/dev/sda1 /media/2\040Downloads ext3 defaults,noatime 0 2
/dev/sda2 /media/2\040Downloads\0402 ext3 defaults,noatime 0 2
sda1 and sda2 in fstab should be sdb1 and sdb2

Open Terminal
Type gksu gedit /etc/fstab
change those two lines so that it looks like this:
/dev/sdb1 /media/2\040Downloads ext3 defaults,noatime 0 2
/dev/sdb2 /media/2\040Downloads\0402 ext3 defaults,noatime 0 2
Sorry, that's my fault. I should have seen the inconsistency between blkid and fstab.

Save the file and reboot
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
Sjonnie
Level 1
Level 1
Posts: 11
Joined: Mon Dec 21, 2009 5:34 pm

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

Post by Sjonnie »

Thx a million man!

The automount works perfectly now. :lol:
ace w1zard
Level 1
Level 1
Posts: 34
Joined: Sun Dec 27, 2009 8:13 pm

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

Post by ace w1zard »

wht do you mean by mount partions on boot becausre when i tried to install mint i had a 200 gb partrions ready for it but idk why i had to make a new one!!! i was soooo dam angry!!! also why does linux take away goodd features when they upgrade, are they trying to make it less GUI for the beginner users!
User avatar
Fred
Level 10
Level 10
Posts: 3337
Joined: Fri Jan 04, 2008 11:59 am
Location: NC USA

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

Post by Fred »

ace w1zard,
wht do you mean by mount partions on boot becausre when i tried to install mint i had a 200 gb partrions ready for it but idk why i had to make a new one!!! i was soooo dam angry!!!
I am sorry, but I don't understand what the question is. Please try to write in a more proper manner and explain yourself better. In a way that your grandfather would understand.

What I got out of your post was that you didn't understand how to install like you wanted. And you became angry, at who I don't know, because of your lack of knowledge.

Without further decipherable information, I really don't know how to help you.

Fred
Insanity: Doing the same thing over and over and each time expecting a different result.

Democracy is 2 wolves and a lamb voting on the menu. Liberty is an armed lamb protesting the electoral outcome. A Republic negates the need for an armed protest.
tassan
Level 1
Level 1
Posts: 18
Joined: Mon Dec 28, 2009 5:31 pm

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

Post by tassan »

I suck at this, I have no clue how to do it XD
Could you make a video of this? it would be a lot easier that way.
Al-linuxnewb
Level 1
Level 1
Posts: 11
Joined: Fri Dec 11, 2009 12:23 pm

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

Post by Al-linuxnewb »

Is it possible to use these instructions to auto-mount a share (from another computer) on boot?

If not, could you tell me where I can do that?

I am trying to simplify the system so that a share is visible to my wife when she logs in, rather than making her "surf" through the system to find it each time she needs to save or retrieve a file.

Thanks,

Al
altair4
Level 20
Level 20
Posts: 10212
Joined: Tue Feb 03, 2009 10:27 am

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

Post by altair4 »

Al-linuxnewb wrote:Is it possible to use these instructions to auto-mount a share (from another computer) on boot?
Actually the form of auto mounting remote shares in fstab sort of resembles the mounting of an ntfs or fat32 partition but the syntax and options are different. If I can find it I know there's a how to somewhere in this form and I'll post it's location later. In the mean time there are two other alternatives:

(1) Bookmark the share.

Have your wife "surf" just as she's always done then once the share is found select "Bookmarks" > "Add Bookmark". It will show up under "Places" in Nautilus sort of like a "mapped drive" does in Windows.

(2) Use this method: http://forums.linuxmint.com/viewtopic.p ... 03#p173559

It will mount on boot and place a mount icon on her desktop automatically.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
chipps61

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

Post by chipps61 »

Fred, just a quick thanks for your original post that started this thread about a year ago. Was just what I needed to know, and worked perfectly.
psurzg
Level 1
Level 1
Posts: 1
Joined: Sun Feb 21, 2010 11:36 pm

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

Post by psurzg »

Hi Mint-guys,

a very simple way to modify /etc/fstab to make the partitions be mounted at boot time is opening Nautilus (file explorer) click on the desired partition (right now it's not mounted, but you can see its name on the left panel), and once it is mounted you have to open a terminal and run "less /etc/mtab" to see the last line in it. Copy this line, and paste it as the last line on /etc/fstab. Reboot.

Ready! Your system will boot with that partition mounted, and this way it won't give you an error when using Nautilus and want to click on the default icon of that partition.


Hope it helps, good luck!
altair4
Level 20
Level 20
Posts: 10212
Joined: Tue Feb 03, 2009 10:27 am

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

Post by altair4 »

psurzg,

This is a HowTo not a request for help. This is how Fred suggests to mount partitions. You'll notice that this howto has managed to survive without anyone coming out of the woodwork suggesting things like ntfs-config, psydm, or any of the other crazy little utilities that are out there.

Oh, BTW , welcome to the forum.

I don't mean to speak for Fred. Perhaps I'm posting out of turn. :oops:
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
SpudGun

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

Post by SpudGun »

I've just come out of the woodwork to suggest a crazy little utilitie, disk-manager from debian sid repo http://packages.debian.org/unstable/disk-manager
This tool will add new drives to fstab just by putting a tick in a box :D How cool is that. I was using it in debian lenny with no problems at all, and i was a bit disapointed not to find it in the mint/buntu repo, so i grabbed it from the sid repo and it installed fine, i didn't need any extras.

I think disk-manager is the answer to everyones prayers :wink:
User avatar
hemimaniac
Level 5
Level 5
Posts: 501
Joined: Thu Feb 04, 2010 1:26 pm
Location: London ON

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

Post by hemimaniac »

sounds like a small improvement over pysdm (gui disk manager from the repos), its a nice gui disk manager that edits the fstab, but there are still a couple places the absolute n00b can still go wrong with it
"Linux allows for one thing above all else - 'A user can truly be themselves!'"
Image
User avatar
Fred
Level 10
Level 10
Posts: 3337
Joined: Fri Jan 04, 2008 11:59 am
Location: NC USA

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

Post by Fred »

SpudGun wrote:
I've just come out of the woodwork to suggest a crazy little utilitie, disk-manager from debian sid repo http://packages.debian.org/unstable/disk-manager
Be careful doing this. The Ubuntu and Debian repos are not binary compatible. If the utility is written in an interpreted language like python and doesn't reference something that isn't there in Ubuntu or Mint then it will work. Mixing repos will get you a broken system if you aren't very careful. :-)

As far as why I suggest using the CLI to set up mounting, it always works correctly. There are lots of stand alone utilities and file managers that will provide this functionality, but most are buggy in one way or another. Using the CLI is universal to all the flavors of Mint, and others, and is proven to give consistent and flexible auto mounting.

Learning to do it from the CLI will serve you well in the long run. :-)

Fred
Insanity: Doing the same thing over and over and each time expecting a different result.

Democracy is 2 wolves and a lamb voting on the menu. Liberty is an armed lamb protesting the electoral outcome. A Republic negates the need for an armed protest.
aelfinn
Level 3
Level 3
Posts: 193
Joined: Thu Dec 11, 2008 2:11 pm

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

Post by aelfinn »

I have a problem related to this topic. My partitions are mounted as follows.

Code: Select all

/dev/sda2 on / type ext4 (rw,errors=remount-ro,commit=5)
/dev/sda3 on /home type ext4 (rw,commit=5)
/dev/sda4 on /media/Data type ext4 (rw)
Thing is, I can't write anything to "Data" (Permission denied), except when using su privileges. The relevant line in fstab is

Code: Select all

/dev/sda4/ /media/Data ext4 defaults 0 0
Any pointers would be much appreciated! :)
altair4
Level 20
Level 20
Posts: 10212
Joined: Tue Feb 03, 2009 10:27 am

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

Post by altair4 »

All entries in fstab mount as owned by root. For windows filetypes ( FAT32 or NTFS ) you can change ownership and permissions in fstab itself. But for linux filesystems you have to change these things after they are mounted. You've got many choices depending on your setup.

For example:

Open Terminal
Type sudo chown -R altair:plugdev /media/Data

This will change owner:group from root:root to altair:plugdev.
Note: By default all local login users are members of the plugdev group.


OR,

Open Terminal
Type sudo chmod -R 0777 /media/Data

This will keep the owner:group as root:root but change permissions to allow everyone read / write access.

OR, an almost infinite combination of the above.

Please note that the "-R" option above stands for "recursive" meaning it will change ownership or permissions on all folders and files within that mountpoint. If it's truly just a Data partition then that may be what you want it to do. If it's another linux install then you just messed up the permissions on that install. If the Data partition holds a backup of your system and you wanted it to preserve permissions it also got messed up. In these cases you might want to leave off the "-R" options so the commands look like this:

sudo chown altair:plugdev /media/Data
sudo chmod 0777 /media/Data

This will change ownership and/or permissions of the mount point ( users will be able to add or delete within that mount point ) but preserve them on the enclosed files.

Did I say make any mistakes, Fred? :wink:
Last edited by altair4 on Tue Apr 06, 2010 6:25 pm, edited 1 time in total.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
Locked

Return to “Tutorials”