Auto Mount Partitions on Boot (also Windows partitions)

Write tutorials and howtos in here
There are more tutorials here http://community.linuxmint.com/tutorial/welcome
Forum rules
Do not start a support topic here please. Before you post please read this

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

Postby austin.texas on Sat Nov 21, 2009 9:10 am

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.
Mint 17 v2 Cinnamon (64 bit), Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Microsoft-free environment since 1996

To help Linux Mint with a donation, please visit http://www.linuxmint.com/donors.php
User avatar
austin.texas
Level 10
Level 10
 
Posts: 3115
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

Linux Mint is funded by ads and donations.
 

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

Postby altair4 on Sat Nov 21, 2009 9:16 am

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:
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 16
Level 16
 
Posts: 6055
Joined: Tue Feb 03, 2009 10:27 am

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

Postby Sjonnie on Thu Dec 24, 2009 7:29 am

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.
Sjonnie
Level 1
Level 1
 
Posts: 12
Joined: Mon Dec 21, 2009 5:34 pm

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

Postby altair4 on Thu Dec 24, 2009 7:51 am

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
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 16
Level 16
 
Posts: 6055
Joined: Tue Feb 03, 2009 10:27 am

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

Postby Sjonnie on Thu Dec 24, 2009 8:34 am

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.
Sjonnie
Level 1
Level 1
 
Posts: 12
Joined: Mon Dec 21, 2009 5:34 pm

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

Postby altair4 on Thu Dec 24, 2009 8:42 am

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.
altair4
Level 16
Level 16
 
Posts: 6055
Joined: Tue Feb 03, 2009 10:27 am

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

Postby Sjonnie on Thu Dec 24, 2009 9:29 am

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]
Sjonnie
Level 1
Level 1
 
Posts: 12
Joined: Mon Dec 21, 2009 5:34 pm

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

Postby altair4 on Thu Dec 24, 2009 9:49 am

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 16
Level 16
 
Posts: 6055
Joined: Tue Feb 03, 2009 10:27 am

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

Postby altair4 on Thu Dec 24, 2009 10:35 am

(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.
altair4
Level 16
Level 16
 
Posts: 6055
Joined: Tue Feb 03, 2009 10:27 am

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

Postby Sjonnie on Thu Dec 24, 2009 10:43 am

# /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.
Sjonnie
Level 1
Level 1
 
Posts: 12
Joined: Mon Dec 21, 2009 5:34 pm

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

Postby altair4 on Thu Dec 24, 2009 11:00 am

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.
altair4
Level 16
Level 16
 
Posts: 6055
Joined: Tue Feb 03, 2009 10:27 am

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

Postby Sjonnie on Fri Dec 25, 2009 5:22 am

Thx a million man!

The automount works perfectly now. :lol:
Sjonnie
Level 1
Level 1
 
Posts: 12
Joined: Mon Dec 21, 2009 5:34 pm

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

Postby ace w1zard on Mon Dec 28, 2009 6:43 pm

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!
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)

Postby Fred on Mon Dec 28, 2009 7:21 pm

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.
User avatar
Fred
Level 10
Level 10
 
Posts: 3356
Joined: Fri Jan 04, 2008 11:59 am
Location: NC USA

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

Postby tassan on Thu Dec 31, 2009 6:37 am

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.
tassan
Level 1
Level 1
 
Posts: 18
Joined: Mon Dec 28, 2009 5:31 pm

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

Postby Al-linuxnewb on Wed Jan 20, 2010 12:16 pm

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
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)

Postby altair4 on Wed Jan 20, 2010 1:29 pm

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: viewtopic.php?f=157&t=30103#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.
altair4
Level 16
Level 16
 
Posts: 6055
Joined: Tue Feb 03, 2009 10:27 am

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

Postby chipps61 on Mon Feb 01, 2010 9:17 pm

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.
chipps61
Level 2
Level 2
 
Posts: 68
Joined: Tue Jan 19, 2010 9:19 pm
Location: Zelienople, PA

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

Postby psurzg on Mon Feb 22, 2010 1:47 pm

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!
psurzg
Level 1
Level 1
 
Posts: 1
Joined: Sun Feb 21, 2010 11:36 pm

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

Postby altair4 on Mon Feb 22, 2010 3:49 pm

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.
altair4
Level 16
Level 16
 
Posts: 6055
Joined: Tue Feb 03, 2009 10:27 am

Linux Mint is funded by ads and donations.
 
PreviousNext

Return to Tutorials / Howtos

Who is online

Users browsing this forum: No registered users and 9 guests