LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-12-2017, 12:40 AM   #1
area1509
LQ Newbie
 
Registered: Sep 2017
Posts: 2

Rep: Reputation: Disabled
How to mount directory on drive 2 to directory on drive 1.


Hi all.
I am running linux mint 18.2 on a dell inspiron 7737 with the dvd drive removed and a hard drive in it's place.
+++++++++++++++++++++++++++++++++++
output of sudo blkid
Code:
/dev/sda1: UUID="6C63-B389" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="31adb522-6ece-4c31-9dd2-e02f7d36fa33"
/dev/sda2: UUID="26f2af11-1d92-4c66-ad9b-99031075b935" TYPE="ext4" PARTUUID="27b2cdf2-fa89-4802-b324-18830e8b8602"
/dev/sda3: UUID="e4f3aef1-bb8a-4a73-a553-6a17c1f59949" TYPE="swap" PARTUUID="f9fa25ca-ad4a-41bf-9de2-d32788976740"
/dev/sdb2: UUID="82aba9ed-4882-511c-0976-123de4efea97" TYPE="ext4" PARTUUID="8fc1a4da-e5ab-46d3-9e7c-ce1993a3585c"
++++++++++++++++++++++++++++++++++++
sda1,sda2,sda3 are all on the boot ssd.
sdb2 is a 1TB spinning hard drive in the dvd bay.

In the root on the 1TB drive I have Documents, Music, Downloads, ETC.

on the boot SSD i have my home directory, I would like to mount the Documents dir on drive 2 to my home Documents.

here is my fstab file anytime I uncomment any of these lines the computer refuses to boot until I comment them out.
I don't understand why please help.

FSTAB
Code:
# /etc/fstab: static file system information.
#
# Use 'blkid' 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>
# / was on /dev/sda2 during installation
UUID=26f2af11-1d92-4c66-ad9b-99031075b935 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda1 during installation
UUID=6C63-B389  /boot/efi       vfat    umask=0077      0       1
# swap was on /dev/sda3 during installation
UUID=e4f3aef1-bb8a-4a73-a553-6a17c1f59949 none            swap    sw              0       0


/dev/disk/by-uuid/82aba9ed-4882-511c-0976-123de4efea97 /mnt/82aba9ed-4882-511c-0976-123de4efea97 auto nosuid,nodev,nofail,x-gvfs-show 0 0

# added by A.J. for user folders >>>>>>>>>>>>>>>>>>>>>>>>>
#/mnt/82aba9ed-4882-511c-0976-123de4efea97/Music		/home/area/Music	ext4	defaults	0	0
#/mnt/82aba9ed-4882-511c-0976-123de4efea97/Documents	/home/area/Documents	ext4	defaults	0	0
#/mnt/82aba9ed-4882-511c-0976-123de4efea97/Downloads	/home/area/Downloads	ext4	defaults	0	0
#/mnt/82aba9ed-4882-511c-0976-123de4efea97/Google-Drive	/home/area/Google-Drive	ext4	defaults	0	0
#/mnt/82aba9ed-4882-511c-0976-123de4efea97/Videos	/home/area/Videos	ext4	defaults	0	0
#/mnt/82aba9ed-4882-511c-0976-123de4efea97/Pictures	/home/area/Pictures	ext4	defaults	0	0
# <<<<<<<<<<<<<<<<<<<<<<<<<<<<<

END FSTAB

Last edited by area1509; 09-12-2017 at 05:37 PM. Reason: Add code tags
 
Old 09-12-2017, 02:13 AM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Code:
mv /home/area1509/Documents /home/area1509/Documents.bak
su
echo "UUID=82aba9ed-4882-511c-0976-123de4efea97 /home/area1509/Documents ext4 defaults,comment=x-gvfs-show 1 2" >> /etc/fstab"
reboot
next time, please use code tags for code.
 
1 members found this post helpful.
Old 09-12-2017, 10:18 AM   #3
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,798

Rep: Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222
If you want to mount a directory (i.e., part of a filesystem) on another directory, you need to use the "bind" mount option.
Code:
/mnt/82aba9ed-4882-511c-0976-123de4efea97/Music /home/area/Music none bind 0 0
You're not mounting a whole filesystem, so you want "none" for the filesystem type.
 
1 members found this post helpful.
Old 09-12-2017, 05:25 PM   #4
area1509
LQ Newbie
 
Registered: Sep 2017
Posts: 2

Original Poster
Rep: Reputation: Disabled
First of all Thank you rknichols you led me in the right direction.

to get this to work I had to first mount the second hard drive like this.

Code:
/dev/disk/by-uuid/82aba9ed-4882-511c-0976-123de4efea97 /mnt/82aba9ed-4882-511c-0976-123de4efea97 ext4 nosuid,nodev,nofail,x-gvfs-show,x-gvfs-name=Disk2 0 0
Mint > Preferences > Disks
Select the disk > Select the partition on the disk > Gear icon > Edit mount options.
Set Automatic mount options to Off
Select Mount at startup
Give it a Display name (I don't know if this did anything)
Change the file system to ext4 (Again I don't know if this did anything)
reload fstab with
Code:
sudo mount -a
edit fstab to add one line for each directory.
Code:
/mnt/82aba9ed-4882-511c-0976-123de4efea97/Music /home/area/Music none bind 0 0
Thank you, Ondoho and rknichols.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Mount secondary hard drive to upload directory nibraz Linux - Server 2 10-24-2016 02:50 PM
[SOLVED] how do I mount a drive's directory to another directory sunbelt57 Linux - General 1 02-17-2016 02:28 AM
[SOLVED] unable to mount a usb flash drive and an SD card after changing mount directory name remn Linux - Newbie 24 10-24-2015 04:04 PM
Mount a directory as a CD/DVD drive?? thomas_fogh Linux - Newbie 4 02-03-2007 05:16 AM
redhat 9 - CD-ROM drive won't mount: "Not a directory" zyzychyn Linux - Hardware 8 06-11-2004 12:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:56 PM.

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