LinuxQuestions.org
Review your favorite Linux distribution.
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 12-03-2014, 11:20 PM   #1
procfs
Member
 
Registered: Jan 2006
Location: Sri Lanka
Posts: 608

Rep: Reputation: 34
USB to have same device file


Hi Is the a way to reserve a device file say /dev/sdz for a usb hard disk. so no matter what I plugin my usb hard disk will have a persistent device file

My env is Redhat linux 6.3

Thanks and regards
 
Old 12-04-2014, 02:38 AM   #2
qlue
Member
 
Registered: Aug 2009
Location: Umzinto, South Africa
Distribution: Crunchbangified Debian 8 (Jessie)
Posts: 747
Blog Entries: 1

Rep: Reputation: 172Reputation: 172
Device files are provided on a first-come-first-serve basis and are provided as needed. So I doubt this is possible.
However, using an entry in /etc/fstab it is possible to assign a preferred path and mount point for external storage devices. For a device specific path, use the UUID of the device.

Read more about this here and here.

Although the Ubuntu Wiki is a little easier to follow.

As an aside, I have an external, usb connected drive that I use frequently. I wanted this to mount automatically and with consistency. But I didn't want any error messages if the drive was not available. Using the drives UUID, I add the following line to my /etc/fstab file;
Code:
UUID="1a5e41b5-01e6-46b6-8400-cf4ba647383a" /media/qlue/wd-backup/ ext4	defaults,nofail 0 2
This causes the drive to mount with a consistent path if connected during boot and even if connected after the system has already booted.
Note that I also created the directory qlue/ in /media/ and the directory wd-backup/ in /media/qlue/ although I think that this may not alway be needed depending on the distro. (some distros may create these paths as needed but I'm not certain.)
 
Old 12-05-2014, 12:36 AM   #3
ndc85430
Member
 
Registered: Apr 2014
Distribution: Slackware
Posts: 92

Rep: Reputation: Disabled
I assume you really mean Red Hat Enterprise Linux. If you're using Red Hat Linux, then you should know that it's obsolete and unsupported.

Quote:
Originally Posted by qlue View Post
Device files are provided on a first-come-first-serve basis and are provided as needed. So I doubt this is possible.
udev was created to solve this problem. Info on writing udev rules can be found at http://www.reactivated.net/writing_udev_rules.html, for example. The document is from 2008, so some things have undoubtedly changed (I believe udevinfo is no longer used and udevadm is used now, for example), but the basics remain the same.
 
1 members found this post helpful.
Old 12-12-2014, 05:09 AM   #4
procfs
Member
 
Registered: Jan 2006
Location: Sri Lanka
Posts: 608

Original Poster
Rep: Reputation: 34
Hi Guys thanks you for the replies

Best regards
 
  


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
transfer file to usb device saharnic Linux - Software 2 08-29-2012 06:00 AM
file transfer from a usb device ashishkd Ubuntu 2 01-28-2012 11:57 PM
How to know which usb keyboard device file. nithima Linux - Newbie 1 04-27-2010 05:23 AM
mapping usb device to device file scerenon Linux - Hardware 12 07-20-2006 04:13 PM
Assign one USB-storage device to one device file Misel Linux - Hardware 1 08-28-2004 03:52 AM


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