Mount drives by default on bootup

Quick to answer questions about finding your way around Linux Mint as a new user.
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. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
ronanstis

Mount drives by default on bootup

Post by ronanstis »

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.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
kukamuumuka

Re: Mount drives by default on bootup

Post by kukamuumuka »

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

Re: Mount drives by default on bootup

Post by ronanstis »

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.
kukamuumuka

Re: Mount drives by default on bootup

Post by kukamuumuka »

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
nomko

Re: Mount drives by default on bootup

Post by nomko »

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 »

@ 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.
ganamant
Level 4
Level 4
Posts: 384
Joined: Sun Mar 29, 2015 4:08 pm

Re: Mount drives by default on bootup

Post by ganamant »

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 20
Level 20
Posts: 10097
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Mount drives by default on bootup

Post by Flemur »

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?
Mark Phelps
Level 7
Level 7
Posts: 1869
Joined: Mon Jun 10, 2013 4:39 pm

Re: Mount drives by default on bootup

Post by Mark Phelps »

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 »

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.
Locked

Return to “Beginner Questions”