Mount drives by default on bootup

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
ronanstis
Level 1
Level 1
Posts: 8
Joined: Mon Sep 22, 2014 10:12 pm

Mount drives by default on bootup

Post by ronanstis » Tue Mar 31, 2015 11:53 pm

If Windows can do it, it must be a piece of cake for Linux! In Windows, the default is for all drives to be mounted at bootup, and, since I go from C: to P: on my computer, this would help me considerably, so I don't have to remember where a particular piece of data is before I run an application which requires it. I'm sure it can be done in Linux, I just can't find where! Help!
System is Linux Mint 17 Qiana.

User avatar
administrollaattori
Level 13
Level 13
Posts: 4994
Joined: Tue Sep 03, 2013 4:51 am
Location: Finland
Contact:

Re: Mount drives by default on bootup

Post by administrollaattori » Wed Apr 01, 2015 12:35 am

Just add mount point to the /etc/fstab file. An example if you have Windows on /dev/sda1

Code: Select all

sudo mkdir /mnt/windows

Code: Select all

gksudo pluma /etc/fstab  # use gedit if you have no pluma
... add the line

Code: Select all

/dev/sda1 /mnt/windows ntfs defaults 0 0
... save, quit and mount windows for the first time

Code: Select all

sudo mount -a
PS. You can use UUID in stead of /dev/XXX also.
PS2. Now Windows is found from /mnt/windows

ronanstis
Level 1
Level 1
Posts: 8
Joined: Mon Sep 22, 2014 10:12 pm

Re: Mount drives by default on bootup

Post by ronanstis » Wed Apr 01, 2015 1:54 am

To administrollaatori,

Tried with little luck. The system is already set up as a multi-boot system, with Win 7 on a 1TB HDD, Data files on a 500 GB HDD and Win XP and Linux on a 320 GB HDD. It boots to Linux by default, but I can choose Win bootloader fom the OS menu, then select either Win 7 (def) or Win XP from the resulting page.
When I entered the suggested command lines (changed as I thought to give me my music), I got:

ron@Roffice ~ $ sudo mkdir /mnt/Win 7 Audio Files
[sudo] password for ron:
ron@Roffice ~ $ gksudo gedit /etc/fstab

(gedit:5520): Gtk-WARNING **: Attempting to set the permissions of `/root/.local/share/recently-used.xbel', but failed: No such file or directory

(gedit:5520): Gtk-WARNING **: Attempting to store changes into `/root/.local/share/recently-used.xbel', but failed: Failed to create file '/root/.local/share/recently-used.xbel.NXY0VX': No such file or directory

(gedit:5520): Gtk-WARNING **: Attempting to set the permissions of `/root/.local/share/recently-used.xbel', but failed: No such file or directory

(gedit:5520): Gtk-WARNING **: Attempting to store changes into `/root/.local/share/recently-used.xbel', but failed: Failed to create file '/root/.local/share/recently-used.xbel.P0T5VX': No such file or directory

(gedit:5520): Gtk-WARNING **: Attempting to set the permissions of `/root/.local/share/recently-used.xbel', but failed: No such file or directory

The gedit line took me to fstab, and I was able to enter and save /UUID/sda1 /mnt/Win 7 Audio Files defaults 0 0 without trouble.

User avatar
administrollaattori
Level 13
Level 13
Posts: 4994
Joined: Tue Sep 03, 2013 4:51 am
Location: Finland
Contact:

Re: Mount drives by default on bootup

Post by administrollaattori » Wed Apr 01, 2015 3:16 am

ronanstis wrote: ron@Roffice ~ $ sudo mkdir /mnt/Win 7 Audio Files
Your mount point is set the wrong way. It should has like

Code: Select all

sudo mkdir /mnt/"Win 7 Audio Files"
... or

Code: Select all

sudo mkdir /mnt/Win\ 7\ Audio\ Files
... and for fstab

Code: Select all

UUID=therightuuidhere /mnt/"Win 7 Audio Files"
You get the UUID when running a command

Code: Select all

sudo blkid

User avatar
nomko
Level 10
Level 10
Posts: 3026
Joined: Sat Feb 25, 2012 7:28 pm
Location: The Hague, The Netherlands

Re: Mount drives by default on bootup

Post by nomko » Wed Apr 01, 2015 4:08 am

ronanstis wrote: (gedit:5520): Gtk-WARNING **: Attempting to set the permissions of `/root/.local/share/recently-used.xbel', but failed: No such file or directory

(gedit:5520): Gtk-WARNING **: Attempting to store changes into `/root/.local/share/recently-used.xbel', but failed: Failed to create file '/root/.local/share/recently-used.xbel.NXY0VX': No such file or directory

(gedit:5520): Gtk-WARNING **: Attempting to set the permissions of `/root/.local/share/recently-used.xbel', but failed: No such file or directory

(gedit:5520): Gtk-WARNING **: Attempting to store changes into `/root/.local/share/recently-used.xbel', but failed: Failed to create file '/root/.local/share/recently-used.xbel.P0T5VX': No such file or directory

(gedit:5520): Gtk-WARNING **: Attempting to set the permissions of `/root/.local/share/recently-used.xbel', but failed: No such file or directory

The gedit line took me to fstab, and I was able to enter and save /UUID/sda1 /mnt/Win 7 Audio Files defaults 0 0 without trouble.
Check here for how to get rid of that Gtk warning:
https://sites.google.com/site/easytipsf ... tk-warning

User avatar
badbodh
Level 2
Level 2
Posts: 51
Joined: Tue Jul 06, 2010 12:50 am
Location: India

Re: Mount drives by default on bootup

Post by badbodh » Wed Apr 01, 2015 5:22 am

@ administrollaattori is right. In linux, path to files/folders must not contain -space- . If -space- comes up in folder name, use quotes.
administrollaattori wrote:

Code: Select all

/dev/sda1 /mnt/windows ntfs defaults 0 0
Using 'defaults' has created troubles with accessing files with dropbox and amarok for me in the past. It didn't allow write/modify (i don't know if that has changed now, do correct me).
I have always used

Code: Select all

/dev/sda1 /mnt/windows  ntfs  rw,auto,noexec,umask=000  0   0
instead.
Windows assumes I'm stupid but Linux proves it.

User avatar
ganamant
Level 4
Level 4
Posts: 282
Joined: Sun Mar 29, 2015 4:08 pm

Re: Mount drives by default on bootup

Post by ganamant » Wed Apr 01, 2015 9:20 am

Spaces in filenames, although permitted, are an endless source of problems, particularly if you venture away from the gui. I suggest that you rename your "Win 7 Audio Files" to something like "Win7AudioFiles" or "win7_audio_files".

User avatar
Flemur
Level 15
Level 15
Posts: 5811
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Mount drives by default on bootup

Post by Flemur » Wed Apr 01, 2015 1:39 pm

Spaces in filenames, although permitted, are an endless source of problems,

Yes. Spaces in filenames is a terrible idea.

You created a dir named /mnt/Win, and also dirs named "7", "Audio", and "Files" in whatever directory you were in when you ran that command - you might want to delete those.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
Mint 18.3 Xfce/fluxbox/pulse-less
Xubuntu 17.10/fluxbox/pulse-less

Mark Phelps
Level 7
Level 7
Posts: 1792
Joined: Mon Jun 10, 2013 4:39 pm

Re: Mount drives by default on bootup

Post by Mark Phelps » Thu Apr 02, 2015 9:45 am

Just make sure that your Audio Files are NOT on the same partition as the Windows 7 OS. IF they are, you need to move them to a different partition -- one that has only data on it. Why? Because mounting a Win7 OS partition read/write in Linux can easily lead to filesystem corruptipon -- and if that happens, Win7 will not be rebootable, making it very hard to fix.

User avatar
badbodh
Level 2
Level 2
Posts: 51
Joined: Tue Jul 06, 2010 12:50 am
Location: India

Re: Mount drives by default on bootup

Post by badbodh » Sat Apr 04, 2015 5:40 pm

Mark Phelps wrote:Because mounting a Win7 OS partition read/write in Linux can easily lead to filesystem corruption -- and if that happens, Win7 will not be bootable, making it very hard to fix.
i did corrupt NTFS partition once, while removing a large movie file, on linux. Later on when i booted to windows 7, it gave warning and ran chkdsk. Lucky it wasn't the C drive. You should use 'ro' instead of 'rw' on sda1 to be safe. Other drives can have 'rw'.
Windows assumes I'm stupid but Linux proves it.

Post Reply

Return to “Newbie Questions”