LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 10-05-2015, 02:04 PM   #1
JosephS
Member
 
Registered: Jun 2007
Distribution: Debian Jessie, Bunsenlabs
Posts: 586

Rep: Reputation: 38
Mounting External Hard drive?


I'm trying to set up a auto backup, so want to figure out how to mount an external hard drive in a script.
According to blkid this is the UUID that is for the external drive:
Code:
joe@crunchbang:~$ blkid
/dev/sdf1: LABEL="root_backup" UUID="0fda3ef4-5a62-43e8-b4e6-6eb655a9c6af" TYPE="ext4"
I put this entry in /etc/fstab:
Quote:
# External hard drive
0fda3ef4-5a62-43e8-b4e6-6eb655a9c6af /media/root_backup ext4 defaults,noauto 0 2
When I try to mount the device with UUID I get an error:
Code:
sudo mount -U 0fda3ef4-5a62-43e8-b4e6-6eb655a9c6af
mount: no such partition found
Also with trying to mount with the diredtory:
Quote:
joe@crunchbang:~$ sudo mount /media/root_backup/
mount: special device 0fda3ef4-5a62-43e8-b4e6-6eb655a9c6af does not exist
I could put an entry in the script like:
Quote:
joe@crunchbang:~$ sudo mount -t ext4 /dev/sdf1 /media/root_backup/
but the device is not always the same.

Any suggestions of how to resolve this?

Thanks
 
Old 10-05-2015, 04:26 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,743

Rep: Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923Reputation: 5923
The correct fstab syntax for using UUID is:

UUID=0fda3ef4-5a62-43e8-b4e6-6eb655a9c6af /media/root_backup/ ext4 defaults,noauto 0 2

Since the filesystem also has a label defined you can also use:

LABEL=root_backup /media/root_backup/ ext4 defaults,noauto 0 2

Last edited by michaelk; 10-05-2015 at 04:29 PM.
 
Old 10-06-2015, 01:24 AM   #3
JosephS
Member
 
Registered: Jun 2007
Distribution: Debian Jessie, Bunsenlabs
Posts: 586

Original Poster
Rep: Reputation: 38
Thanks
I realize my mistake
 
  


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
Mounting my external hard drive brunobrunt Linux - Newbie 8 08-29-2013 09:04 PM
mounting external hard drive perrywillis@cox.net SUSE / openSUSE 5 10-16-2006 01:22 AM
Mounting my external hard drive... Azzath Linux - Hardware 8 02-26-2005 03:27 AM
mounting an external hard drive adin Linux - Hardware 1 01-04-2005 04:18 AM
Mounting external hard drive gadgetboy Linux - Newbie 3 02-02-2003 08:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 02:58 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