LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Mount USB drive using something other then /dev/sdcx (https://www.linuxquestions.org/questions/linux-newbie-8/mount-usb-drive-using-something-other-then-dev-sdcx-884830/)

linuxguy7820 06-06-2011 11:02 AM

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

RockDoctor 06-06-2011 11:30 AM

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

andrewthomas 06-06-2011 11:31 AM

They are static.

You could also use any of them in your in your fstab

roygbiiv 06-06-2011 01:46 PM

Quote:

Originally Posted by linuxguy7820 (Post 4377904)
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

linuxguy7820 06-06-2011 02:38 PM

Thanks for the assist & answers...


All times are GMT -5. The time now is 10:34 AM.