LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-12-2014, 05:38 AM   #1
csegau
LQ Newbie
 
Registered: Oct 2009
Posts: 27

Rep: Reputation: 0
assign device name to USB key after assigning device name to hard disk.


Hi All,

In my PC i have 3 hard disk connected and auto-mount of USB key is not allowed.

But we have an exceptional case, to mount USB key if it has some content in it , this content is pre-defined.

For Example, mount USB key if it has 2 files "File1.txt" & "File2.txt" else do not mount it.

i have written USB rule, this rule runs every time USB key is connected. This rule then call script. This script internally mount the USB key, check for the "File1.txt" & "File2.txt" presence. If present then mount USB key to different mount location, else un-mount the USB Key.


below is my problem:

1. i have a USB key which has "File1.txt" and "File2.txt" as content.
2. During reboot, my USB rule is triggered and USB key is mounted.
3. So USB get assigned device type as "/dev/sda". while other 3 hard disk get assigned as below
hard disk 1 = /dev/sdb
hard disk 2 = /dev/sdc
hard disk 3 = /dev/sdd

instead i want my hard disk to get device name from "/dev/sda"... and assign device name to USB key at last.

please suggest how can i do this.

Thank in advance.
 
Old 01-12-2014, 11:03 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 26,456

Rep: Reputation: 6215Reputation: 6215Reputation: 6215Reputation: 6215Reputation: 6215Reputation: 6215Reputation: 6215Reputation: 6215Reputation: 6215Reputation: 6215Reputation: 6215
What distribution / version are you running? Most these days mount file systems based upon its UUID or label so knowing the actual device ID is not required.

Does your system boot normally with the USB drive installed? Without knowing anything what you are doing can you mount the USB drive via its label?
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] binary copy to usb device, not flash drive or hard disk Pedulla Linux - General 1 09-15-2012 08:12 PM
[SOLVED] Udev creates the external usb hard disk device node too late pastoreerrante Linux - Software 2 05-24-2010 01:42 AM
USB drive not working properly, read only device? (USB key storage device) Arodef Linux - Hardware 14 01-01-2010 08:32 AM
External USB DISK: Failure to assign device telemeister Slackware 7 11-27-2009 05:30 AM
Assign one USB-storage device to one device file Misel Linux - Hardware 1 08-28-2004 04:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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