LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Bodhi
User Name
Password
Bodhi This forum is for the discussion of Bodhi Linux.

Notices


Reply
  Search this Thread
Old 07-03-2020, 10:04 PM   #1
questionsBot
Member
 
Registered: Jun 2020
Posts: 104

Rep: Reputation: Disabled
run a script on boot to auto mount?


I would like to automount a directory on boot automatically... how would I go about that? I assume I need to write a script.. but how to get that to automatically run?

Basically I want to auto mount my windows partition. It works fine, and I can access it as long as I click the "drive" in file manager to mount it... but I need it to automout.

Last edited by questionsBot; 07-03-2020 at 10:11 PM.
 
Old 07-03-2020, 10:38 PM   #2
questionsBot
Member
 
Registered: Jun 2020
Posts: 104

Original Poster
Rep: Reputation: Disabled
I found a solution for mounting a drive....

use these two commands...
Code:
sudo fdisk -l
sudo blkid
fdisk will display your drives and blkid will show you the drive UUID

Then type
Code:
sudo nano /etc/fstab
And then at the very bottom add this line...
Code:
UUID=14D82C19D82BF81E /MountPointDirectory auto nosuid,nodev,nofail,x-gvfs-show 0 0
but replace the UUID and the mount point directory to w/e you wish.

This is the exact lines I added to the bottom of my file.
Code:
#
# Add AutoMount
UUID=A224420E2441E5BF /home/itisme/WindowsData  auto nosuid,nodev,nofail,x-gvfs-show 0 0
NEW QUESTION :

How can I automount a directory, rather than an entire drive?
 
Old 07-03-2020, 10:41 PM   #3
cordx
Member
 
Registered: Oct 2018
Location: texas
Distribution: bodhi 5.1.0
Posts: 797

Rep: Reputation: 184Reputation: 184
you should be able to do that by adding an entry for your windows partition to your fstab (in /etc).
 
Old 07-03-2020, 11:06 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,784

Rep: Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937
To elaborate on cordx's post you can not just mount a single directory on a filesystem but you can use a bind mount to provide an alternative view to the existing directory tree.

If you mount your windows drive to say /mnt/WindowsData you can then create another mount point to the desired directory within the drive.

/etc/fstab entery would look like.

/mnt/WindowsData/subdirectory /home/itsisme/subdirectory none defaults,bind 0 0

There is also a fuse filesystem bindfs that can do the same thing without having to have a fstab entry.
 
2 members found this post helpful.
Old 07-03-2020, 11:06 PM   #5
cordx
Member
 
Registered: Oct 2018
Location: texas
Distribution: bodhi 5.1.0
Posts: 797

Rep: Reputation: 184Reputation: 184
Quote:
Originally Posted by questionsBot View Post
NEW QUESTION :

How can I automount a directory, rather than an entire drive?
how do you mean? once the partition is mounted, your os should have access to all of the directories located therein.
 
Old 07-04-2020, 12:26 AM   #6
questionsBot
Member
 
Registered: Jun 2020
Posts: 104

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
To elaborate on cordx's post you can not just mount a single directory on a filesystem but you can use a bind mount to provide an alternative view to the existing directory tree.

If you mount your windows drive to say /mnt/WindowsData you can then create another mount point to the desired directory within the drive.

/etc/fstab entery would look like.

/mnt/WindowsData/subdirectory /home/itsisme/subdirectory none defaults,bind 0 0

There is also a fuse filesystem bindfs that can do the same thing without having to have a fstab entry.
perfect! Thanks!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need auto run in games without an auto run, used to use AutoHotKey in Windows, trying AutoKey, but having problems eric1234 Linux - Games 15 02-01-2019 11:58 AM
[SOLVED] Thunar: turning off auto-open for auto-mount newbiesforever Linux - Software 2 04-11-2016 11:42 AM
Auto-mount windows share on boot - manual OK, auto not ok! erskie Linux - Newbie 2 02-12-2008 06:42 PM
autofs enabled in kernel but auto.mount and auto.master are NOT in /etc! Alybyzrp Linux - General 0 11-11-2003 12:26 PM
SCRIPT: check if auto-mount mount-points are still mounted markus1982 Linux - Software 0 05-25-2003 05:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Bodhi

All times are GMT -5. The time now is 01:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration