LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 06-06-2011, 12:02 PM   #1
linuxguy7820
Member
 
Registered: Mar 2011
Distribution: CentOS, RHEL, Fedora
Posts: 35

Rep: Reputation: 0
Mount USB drive using something other then /dev/sdcx


Hi:

I'm using an external USB drive to perform system backups. The script I'm using has a mount command - mount /dev/sdcx /systembak, it works fine until the external drive is mounted into a different USB port which causes the device path to change and the script needs to be modified to reflect that change. Looking in the /dev/disk/ directory I see ./by-id ./by-label ./by-path ./by-uuid. I've been able to mount the disk using one of the device pointers in those directories; are any of those device pointers static or do they change every time the USB disk is plugged into a different USB port.

OS: RHEL/CentOS

(I don't have the ability to actually test it right now which is why I'm asking the question)

_thanks
 
Old 06-06-2011, 12:30 PM   #2
RockDoctor
Senior Member
 
Registered: Nov 2003
Location: Minnesota, US
Distribution: Fedora, Linux Mint, Ubuntu
Posts: 1,504

Rep: Reputation: 325Reputation: 325Reputation: 325Reputation: 325
Looks like the symlink name in /dev/disk/by-label is not affected by the choice of USB port. The device to which the symlink points changes as appropriate. HTH
 
Old 06-06-2011, 12:31 PM   #3
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 308Reputation: 308Reputation: 308Reputation: 308
They are static.

You could also use any of them in your in your fstab
 
Old 06-06-2011, 02:46 PM   #4
roygbiiv
LQ Newbie
 
Registered: May 2011
Distribution: Arch Linux
Posts: 25

Rep: Reputation: 13
Quote:
Originally Posted by linuxguy7820 View Post
Hi:

I'm using an external USB drive to perform system backups. The script I'm using has a mount command - mount /dev/sdcx /systembak, it works fine until the external drive is mounted into a different USB port which causes the device path to change and the script needs to be modified to reflect that change. Looking in the /dev/disk/ directory I see ./by-id ./by-label ./by-path ./by-uuid. I've been able to mount the disk using one of the device pointers in those directories; are any of those device pointers static or do they change every time the USB disk is plugged into a different USB port.

OS: RHEL/CentOS

(I don't have the ability to actually test it right now which is why I'm asking the question)

_thanks
It is safe to mount your drive by label like this
Code:
mount LABEL=your_drives_label /systembak/
because the label will only change if you manually change it. You can find your drive's label in /dev/disk/by-label/. You may also define this default behaviour in /etc/fstab.

Hope this helps
 
Old 06-06-2011, 03:38 PM   #5
linuxguy7820
Member
 
Registered: Mar 2011
Distribution: CentOS, RHEL, Fedora
Posts: 35

Original Poster
Rep: Reputation: 0
Thanks for the assist & answers...
 
  


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
when i mount my USB Flash Drive A Messenge has come that mount: can't find /dev/sda/h feda82 Red Hat 2 12-24-2005 08:16 AM
when i mount my USB Flash Drive A Messenge has come that mount: can't find /dev/sda/h feda82 Red Hat 1 12-24-2005 05:25 AM
when i mount my USB Flash Drive A Messenge has come that mount: can't find /dev/sda/h feda82 Red Hat 2 12-24-2005 03:15 AM


All times are GMT -5. The time now is 02:30 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration