LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 04-14-2023, 06:46 PM   #1
Krupski
Member
 
Registered: Jan 2015
Location: The worst state in USA (can you guess?)
Distribution: Debian 11 (x86_64)
Posts: 44

Rep: Reputation: 0
Rename serial device. Possible?


Hi all,

Using Debian Linux 64 bit if it matters.

I have a neat little board which has a DB-9 connector on one end and a 4 pin USB 2.0 header on the other end (a Startech ICUSB232INT1) which uses the FTDI232RL chip and a TTL to Serial level converter.

It works fine, and since it's plugged into a motherboard USB header, it's available right away.

It exists as /dev/ttyUSB0 and, if possible, I would like to change it's name to something else.

I would guess the solution to my request lies in UDEV, but I have no clue how to do it.

Since I have a lot of other adapters which I sometimes use (which have either /dev/ttyUSBx or /dev/ttyACMx names), I would like the "permanent" USB0 device named something else so I can easily see which device I am working with at the time.

If this is possible, I would greatly appreciate some guidance. Thanks!
 
Old 04-14-2023, 08:17 PM   #2
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,010

Rep: Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629
You are right.

The dynamic device directory and the udev rules infrastructure make it possible to provide stable names for all disk devices—regardless of their order of recognition or the connection used for the device. Every appropriate block device the kernel creates is examined by tools with special knowledge about certain buses, drive types or file systems. Along with the dynamic kernel-provided device node name, udev maintains classes of persistent symbolic links pointing to the device:
 
Old 04-19-2023, 11:55 PM   #3
Krupski
Member
 
Registered: Jan 2015
Location: The worst state in USA (can you guess?)
Distribution: Debian 11 (x86_64)
Posts: 44

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by jefro View Post
You are right.

The dynamic device directory and the udev rules infrastructure make it possible to provide stable names for all disk devices—regardless of their order of recognition or the connection used for the device. Every appropriate block device the kernel creates is examined by tools with special knowledge about certain buses, drive types or file systems. Along with the dynamic kernel-provided device node name, udev maintains classes of persistent symbolic links pointing to the device:
Thanks for the reply. Can you give me a few pointers as to how to do this? I tried writing a UDEV rule and the best I could accomplish was to get a symlink to the device, but the original device name persisted (that is, the device now had two names). What I need is for "/dev/ttyUSB0" to become "unused" and given some other name so that when ANOTHER similar device is plugged in, IT becomes ttyUSB0. Make sense?
 
Old 04-20-2023, 12:57 AM   #4
lvm_
Member
 
Registered: Jul 2020
Posts: 970

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
You can create links to devices and name them the way you want.
 
Old 04-20-2023, 03:11 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,147

Rep: Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124
Quote:
Originally Posted by Krupski View Post
I tried writing a UDEV rule and the best I could accomplish was to get a symlink to the device, but the original device name persisted (that is, the device now had two names). What I need is for "/dev/ttyUSB0" to become "unused" and given some other name so that when ANOTHER similar device is plugged in, IT becomes ttyUSB0. Make sense?
Nope. It may well have more than two names - why do you care ?.

Everyone uses the alias they assign and probably soon forget the original name even still exists.
 
  


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
LXer: GUI To Batch Rename Files On Linux With Exif And Music Tags Support: Inviska Rename LXer Syndicated Linux News 0 05-25-2019 12:07 PM
LXer: How to rename user in Linux (also rename group & home directory) LXer Syndicated Linux News 0 06-26-2018 12:54 PM
LXer: How to rename user in Linux (also rename group & home directory) LXer Syndicated Linux News 0 11-28-2017 07:53 PM
Rename network interface (Rename ppp0 ...) Nicolas1390 Linux - Newbie 2 08-08-2011 02:14 AM
Is it possible to access an IrDA device as a serial device such as /dev/ttyUSB0? cricketlong Linux - Hardware 1 05-24-2011 03:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 11:53 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
Open Source Consulting | Domain Registration