LWN.net Logo

User-friendly disk names

By Jake Edge
June 22, 2011

Device names, particularly for disks, can be confusing to Linux administrators because they get assigned at boot time based on the order in which the disks are discovered. So the same physical disk can be assigned a different device name (in /dev) on each boot, which means that kernel log messages and the output of various utilities may not correspond with the administrator's view of the system. A recent patch set looks to change that situation, but it is meeting some resistance from kernel hackers who think it should be handled by user space.

The patches posted by Nao Nishijima are pretty straightforward. They just add a preferred_name entry to struct device, which can be updated via sysfs. The patches then change some SCSI log messages and /proc/partitions output to use the preferred name if it has been set. Greg Kroah-Hartman expressed concerns about changing /proc/partitions as various tools parse that file so it is part of the kernel's user-space interface. Adding the preferred name as a new field on each line might very well confuse utilities that parse the file.

More importantly, though, he notes that one could just change the tools so that they use the names as arguments or in their output. Any scheme that would map preferred names to specific disks requires some kind of mapping file, so tools that wanted to use these preferred names (things like mount, smartd, and other disk-related tools) could do so using that mapping without involving the kernel at all:

Seriously, this could be done by now, it's been over a year since this was first discussed. All distros could have the updated packages by now and this would not be an issue.

I still think this is the correct way to solve the problem as it is a userspace issue, not a kernel one.

While the patches only use preferred_name for disk devices, the idea is to allow them to be added to any device (and then change log messages and utilities to use them). It is modeled after the ifalias entry that was added for network devices back in 2008, but some don't see that as something to emulate. Allowing only one alias for network devices is generally not enough "because people want not a single but multiple names at the same time", Kay Sievers said, so ifalias is only used by some SNMP utilities. Currently, udev maintains a set of links in /dev/disk/by-* that relate disks to kernel devices by a variety of characteristics (ID, label, path, and UUID). James Bottomley would like to see that be extended for the preferred names:

All userspace naming will be taken care of by the usual udev rules, so for disks, something like /dev/disk/by-preferred/<fred> which would be the usual symbolic link.

This will ensure that kernel output and udev input are consistent. It will still require that user space utilities which derive a name for a device will need modifying to print out the preferred name.

But there are problems inherent in that idea. In order for udev to know that the preferred name was set, a uevent would have to be generated. That could be done, but it leads to other problems, as Sievers points out (instead of by-preferred, he uses by-pretty):

What would happen if we mount:
    /dev/disk/by-pretty/foo
and some tool later thinks the pretty name should better be 'bar', it writes the name to /sys, we get a uevent, the old link disappears, we get a new link, mount has no device node anymore for the mounted device ...

Essentially, udev keeps track of the devices present in the system (and their attributes like, potentially, preferred name), but doesn't have any concept of tracking "no longer valid names" as Sievers puts it. That means that udev can't just leave older entries around when user space changes the preferred name: "We can not just add stuff to /dev without a udev database entry, it would never get removed on device unplug and leave a real mess behind."

One possible solution for the renaming problem is to only allow one write to preferred_name, so that, once established, those aliases couldn't be changed without a reboot. udev could set up the proper links, and various tools could use the aliases as needed. That would solve the renaming problem at the cost of some flexibility. In general, no one was really opposed to the idea of some kind of more-mnemonic name for disks, it is more of a question of how to get there.

Sievers proposed adding a way for udev to list all of the symlinks that it creates during device discovery. Anyone (or any tool) that needed to associate an alias with a particular disk could use that output to determine the current device being used (based on the UUID for example), then make the substitution as appropriate. That would work, in general, but Bottomley sees it as overly complex for users:

However, even if we assume they choose one of the current names, they still have to do the mapping manually; even if they have all the information, they can't just cut and paste from dmesg say, they have to cut, edit the buffer to put in the preferred name and then paste ... that's just one annoying step too far for most users. I agree that all the output tools within reason can be fixed to do this automatically, but fixing cat say, just so cat /proc/partitions works would never be acceptable upstream.

The reason for storing this in the kernel is just that it's easier than trying to update all the tools, and it solves 90% of the problem, which makes the solution usable, even if we have to update tools to get to 100%.

But Sievers and driver core maintainer Kroah-Hartman see it as papering over more substantial issues. Sievers, at least, would like to see text-file-style debug and error message output replaced (or supplemented) with something more structured:

We need _smart_ userspace with a debug/error message channel from the kernel to userspace that pops out _structured_ data. Userspace needs to index the data, and merge a lot of userspace information into it.

Adding just another single-name to the kernel just makes the much-too-dumb free-text printk() a bit more readable, but still sounds not like a solution. Pimping up syslog is not the solution to this problem, and it can't be solved in the kernel alone.

But, from the user's perspective, disks may already have names (with labels on the enclosures themselves for example) and it would be quite convenient for the kernel's messages to reflect them. In the end, Sievers isn't opposed to a disk-specific (rather than for all devices) solution, though he thinks it isn't really the right direction to go. Kroah-Hartman agrees and is adamant that this change not go into the driver core. Based on that, Nishijima plans to redo the patches, moving the name to struct gendisk, renaming the field to alias_name (rather than "preferred") to better reflect its purpose, and generating a uevent when the name changes.

But, following the lead of the network ifalias will add to the kernel's user-space interface, only this time for disks. While it may solve an immediate problem for administrators, it will also leave behind some legacy code when, or if, a better solution comes around. That's unfortunate, but, since it solves a real problem, and the change is restricted to subsystem whose maintainer (Bottomley) is in favor of it, it may well turn up in the mainline before long. Any change to system error and debug logging along the lines of what Sievers described is certainly quite a ways off, though there have long been calls for structured kernel output. Sometimes it is just easier to make a change like this in one place, rather than trying to identify and fix all of the places outside of the kernel that would need it.


(Log in to post comments)

User-friendly disk names

Posted Jun 23, 2011 11:42 UTC (Thu) by NRArnot (subscriber, #3033) [Link]

A related issue. The one thing that most annoys me as a linux sysadmin is that it's hard work to tell what sdc2 might be, when it logs errors, and those errors get centrally logged from umpteen systems that I look after, and then digestified via logwatch or similar.

It might be a disk storing someone's /home that's in trouble.

But usually it's just some USB device (phone, Mp3-player, camera) pretending to be a disk (often rather less than successfully).

Quite often the user plugged it in just to recharge its batteries, and isn't even interested in transferring data. (That raises other issues. Linux may auto-mount it. Does the subsequent un-plug without dismount create any significant risk of data-corruption, ot just annoyingly logged errors? )

Anyway, when logging an error, it woud be a godsend if instead or as well it could tag the message with something like the device model and serial number (as revealed by smartctl -i), or at the very least say that it's attached to USB port x or SATA port n or whatever.

It was actually easier when disks were usually hdx and USB devices sdx!

User-friendly disk names

Posted Jun 23, 2011 12:01 UTC (Thu) by jengelh (subscriber, #33263) [Link]

>It was actually easier when disks were usually hdx and USB devices sdx!

Udev to the rescue, see /dev/disk/by-path! (Because that is what hdx reflected in a way.)

User-friendly disk names

Posted Jun 23, 2011 23:43 UTC (Thu) by giraffedata (subscriber, #1954) [Link]

But we're talking about kernel device names, not names of device special files. When the kernel warns about errors on a disk device, it identifies it by kernel device name and udev is irrelevant.

Except with at least some of these proposals, where udev could give the kernel a more meaningful name to use in communicating with the user.

The "sdaq" naming is really just a waste of a namespace. The kernel might as well talk to you in major/minor numbers.

User-friendly disk names

Posted Jun 30, 2011 8:32 UTC (Thu) by zdzichu (subscriber, #17118) [Link]

But udev helps you to map sdX to real hardware:

# ls -lR /dev/disk/by-* | grep sdc1
lrwxrwxrwx. 1 root root 10 06-22 09:36 ata-ST3250820AS_6QE0XHAV-part1 -> ../../sdc1
lrwxrwxrwx. 1 root root 10 06-22 09:36 scsi-SATA_ST3250820AS_6QE0XHAV-part1 -> ../../sdc1
lrwxrwxrwx. 1 root root 10 06-22 09:36 pci-0000:00:1f.2-scsi-3:0:0:0-part1 -> ../../sdc1
lrwxrwxrwx. 1 root root 10 06-22 09:36 4e11c761-2597-4b20-8e86-b9eac0a665d0 -> ../../sdc1

I'm sure there is some "udevadm info" invocation which will do the same and even provice more info.

User-friendly disk names

Posted Nov 13, 2011 14:26 UTC (Sun) by Baylink (guest, #755) [Link]

Yeah, but only if you *get* a /dev/sdx name. I'm playing with Open-iSCSI for the first time, on Suse, under Xen, and I can only get it to do that for the first two mounts; after /dev/sdb, I don't get a device anymore. I assume there's some knob I haven't found yet, but the doco on Open-I is kinda thin on the ground...

This planning treads much the same ground as the best writeup I found on the topic:

http://www.idevelopment.info/data/Unix/Linux/LINUX_Connec...

and indeed, that gent's userspace approach may well belie the arguments of those who say this needs to be kernel-side, all by itself.

User-friendly disk names

Posted Jun 23, 2011 12:30 UTC (Thu) by cladisch (✭ supporter ✭, #50193) [Link]

> some USB device (phone, Mp3-player, camera) …
> Linux may auto-mount it. Does the subsequent un-plug without dismount create any significant risk of data-corruption, ot just annoyingly logged errors?

Data corruption happens only when some cached data was not completely (i.e., partially or not at all) written to the device. As long as the user (or his desktop environment) did not actually try to write anything, everything should be fine.

Furthermore, all these devices use FAT(32), and that FS is so simple that a partially written file usually does not affect the data structures of other files.

User-friendly disk names

Posted Jun 24, 2011 11:56 UTC (Fri) by dps (subscriber, #5725) [Link]

Speaking personally, I don't find things like /dev/sdc a problem. What irks me is that when I reboot /dev/sdc can turn out to be a completely different disc. This problem is particularly severe for some raid controllers.

A fixed, sane and stable mapping between the physical location in raid device and the name would avoid a lot of pain and drastically simplify some code. Most developers don't have this hardware but some commercial solutions do. Let is suffice to say that handling this problem is user space is *very* painful and the most vendor tools are both awful and closed source.

LSI logic's latest offering says "Note: end users should not use the sas2ircu utility. Instead they should ise the LSI SAS2 BIOS Configuration Utility <... all the rest snipped...>". What were they smoking? Do they really think that the BIOS utility is a good solution when working on a production server from a remote location?

User-friendly disk names

Posted Jun 24, 2011 16:52 UTC (Fri) by Lennie (subscriber, #49641) [Link]

Isn't that what blkid/UUID is for ?

User-friendly disk names

Posted Jun 24, 2011 22:22 UTC (Fri) by mikov (subscriber, #33179) [Link]

I have never found a good way to assign persistent names to USB-to-serial adapters. After all ideally the name should identify the USB port where the device is plugged, not the order of plugging.

Currently I do it with udev rules mapping physical device paths (which includes PCI and USB)to names but UDEV constantly complains that PHYSDEVPATH is deprecated. I have no idea what the "preferred" solution is.

In Windows all devices by default have persistent physical location ids. It is even possible to associate completely different drivers with the same devices plugged into different PCI slots. We still have some ways to go before reaching equality even with Windows 2000's device model.

User-friendly disk names

Posted Jun 24, 2011 22:41 UTC (Fri) by dlang (✭ supporter ✭, #313) [Link]

unfortunately the computer does not know which port the adapter is being plugged into in many cases because there is a hub built into the system.

PCI slots are very different that USB buses. with PCI each slot is uniquely identified, with USB there is no connector-based identifier, there is a bus identifier, and then the device identifier

User-friendly disk names

Posted Jun 24, 2011 22:53 UTC (Fri) by mikov (subscriber, #33179) [Link]

USB ports are identifiable in much the same way as PCI slots. As I mentioned, I have been doing it successfully with rules like this:

SUBSYSTEM=="tty", KERNEL=="ttyUSB*", ENV{PHYSDEVPATH}=="/devices/pci0000:00/0000:00:0f.4/usb1/1-1/1-1.2/1-1.2:1.0/ttyUSB*", SYMLINK+="ttyUSB1012"

User-friendly disk names

Posted Jun 24, 2011 23:15 UTC (Fri) by dlang (✭ supporter ✭, #313) [Link]

down through usb1 it is unique, but that is just saying usb bus #1. some systems have separate buses for each physical port on the system, but others have a hub so one bus has multiple ports.

everything after the usb1 (all the 1-1* sections) are dynamically allocated at the time the device is plugged in.

if you only ever plug one device into a port, then you can name things this way, but if there is a hub or multi-function device involved, it depends on the order that they are identified.

nowdays a lot of monitors and keyboards have hubs in them.

User-friendly disk names

Posted Jun 24, 2011 23:48 UTC (Fri) by mikov (subscriber, #33179) [Link]

Cr*p! I didn't know that. This adds to the ever growing list of beers that I should buy to various LWN members for valuable insights they provide. Are you in the Bay Area? :-)

You are saying that there is no theoretical way to identify the port in an USB hub where a device is inserted. So my scheme kind'a works only because it correctly identifies separate buses, and because already plugged devices in the same bus are enumerated in the same order. But if I start unplugging and plugging devices attached directly to a hub, I am screwed.

If I only could get my hands on the idiots who designed USB :-) Starting from the asymmetric connector and now down to this.

All that said, my complaint about the PCI device identification in the device model is still valid.

User-friendly disk names

Posted Jun 25, 2011 0:44 UTC (Sat) by dlang (✭ supporter ✭, #313) [Link]

in some ways it's worse than you think, the order devices are detected in when they are all plugged in at power up is partially determined by how fast each driver is initialized, a major speed change in a driver could change the order.

the thing you need to remember about USB is that is was initially designed for cheap, low-end, low speed devices like keyboards. Electrically it is a _very_ simple design.

you have four wires

power
clock
data
ground

the signaling over the data and clock wires is also pretty primitive (it's basically the i2c bus with a little more definition over the data standard)

all that a non-powered USB hub consists of is multiple sockets wired together (NO active electronics at all)

a powered hub is only required to add a power supply to this.

(now frequently hubs do add a bit more logic so that they can respond to queries from devices to answer how much power they can provide, but that's not a requirement of the USB 1.0 spec)

as for the funny connector, it was designed primarily to be cheap, then to be durable. it was copied from one of the popular console game systems that used it for the joysticks. They then made the ends of the cable different to make it impossible to plug things in incorrectly (and then people didn't like the size of the connector, so they made a different one, and a different one,.....)

over time things have gotten faster (by a factor of 100 or so), but everything is still backwards compatible so that you can take the oldest USB device and plug it into the newest system and things will work (everything on the bus will slow down to the speed of the slowest device on the bus, but it will function). USB was designed to be _extremely_ forgiving for slow or extremely low capability devices

device identification on USB is supposed by be done by a unique identifier in each device, but as USB interfaces have gotten cheaper (and moved from needing several chips, including separate rom/ram chips to being a tiny section of built-in logic 'thrown in' on a $5 chip in addition to the main functionality) the process and capability to give each device a unique serial number has fallen by the wayside (and/or cheap, short-sighted manufacturers have opted to shave pennies off their costs by not bothering to program the serial numbers on the devices) and the result is that sometimes there is no theoretical way to tell two devices apart once you are talking to them (you have to depend on what bus are they plugged into, which falls apart with hubs, at which point the only thing you can do is to depend on what order they were plugged in)

USB today is doing things never imagined by the designers, and in fact doing things that if you had asked the designers, they would have told you were explicitly _not_ in the world of things they designed USB for (due to the cost of implementing the interface with the technology of the time). For a lot of things that USB is being used for today, their answer would have been "use FireWire, it's designed for that sort of performance"

User-friendly disk names

Posted Jun 25, 2011 1:22 UTC (Sat) by mikov (subscriber, #33179) [Link]

Thanks for the background. I appreciate it.

In our case, we are using several USB to serial converters plugged into a couple of hubs. They are supposed to be the same, so it is not the manufacturers fault that they are indistinguishable by anything other than their physical connection. Unfortunately there is no reasonably priced alternative to USB,

A single multi-port USB to serial converter would address this nicely, but
we have evaluated about a dozen of them, and while all they work perfectly in Windows, they are either unsupported in Linux at all, or horribly broken (like dropping a byte every couple of hours). It is an embarrassing shame. I wish our company had the resources to sponsor somebody to fix that.

The only multi-port converter that worked well (other than not having its "non-free" firmware in Debian), and was reasonably cheap and available in the USA, was an old Keyspan 4-port model, which is no longer manufactured...

User-friendly disk names

Posted Jun 25, 2011 3:44 UTC (Sat) by dlang (✭ supporter ✭, #313) [Link]

each serial adapter should have a unique serial number, you should be able to define the udev rules based on that, at that point it won't matter what order they are detected in. this will have headaches when you move adapters from one machine to another, but you could label each adapter with it's own number and make the resulting device name include that number

User-friendly disk names

Posted Jun 26, 2011 1:37 UTC (Sun) by mikov (subscriber, #33179) [Link]

That is a good idea, but tracking each converter's serial number and manually configuring each machine with it is not practical in a manufacturing process.

However I see how a hybrid solution could work. Our current approach with PHYSDEVPATH does work if all devices are plugged in, so knowing that this the case we could use it to automatically generate a one time mapping from a USB serial number to location. It is still a pain because the mapping will have to be re-generated if a converter is replaced (and they do fail out in the field, being the cheap pieces of garbage that they are), but it is a conceptually robust solution.

Sigh, I do miss the olden days of ISA, i2c and even PCI. Now PCIE has been relegated to being a "server technology" in practice.

User-friendly disk names

Posted Jun 26, 2011 3:02 UTC (Sun) by dlang (✭ supporter ✭, #313) [Link]

how is setting up a one-time mapping of serial numbers to physical mapping different from setting up serial number to function mapping?

as for other technologies,

i2c has the exact same problem as USB, the only identity possible is what's reported by the device.

PCI has a slot number ID, but I've seen different versions of the kernel detect the multiple PCI buses in a different order

ISA didn't have any slot identifier, everything was based on the configuration of the individual board.

depending on how many of these serial adapters you need, your best bet may be to buy them from a more upstream provider, you could probably get someone to program a bunch of them with a set of identifiers (i.e. if you need 5 serial ports, get a bunch of them labeled and electronicly identified as #1, a bunch as #2, etc), then your udev rules could map them properly and your only limitation would be that you only replace a #1 with a #1

User-friendly disk names

Posted Jun 27, 2011 3:17 UTC (Mon) by mikov (subscriber, #33179) [Link]

It is conceptually the same, but when you are dealing with production you you have to think about how to reliably and cheaply duplicate this for hundreds of devices. The device serial number is useless unless you have a way to _automatically_ map it to a physical location.

About PCI: you don't use the bus number at all. The sequence of PCI device:function id-s starting from the root bridge through all downstream bridges and ending at the device gives you a guaranteed unique mapping for that hardware regardless of BIOS, kernel, etc. You only need to define a mapping once for a motherboard/CompactPCI chassis and you get a reliable physical slot identification. That is how it is supposed to work and incidentally that is how Windows identifies its PCI devices.

udev and sysfs provide the same information, so it is technically possible to get the same functionality in Linux.

In a previous life I had to do stuff like hack an embedded PC BIOS and Windows bus driver to support huge numbers of PCI devices. The BIOS code was so bad it was scary (to this day I am impressed that PCs can boot at all), but the PCI bus itself at the logical level was a joy.

So purely as a user of USB, I naively believed that it was similar to PCI.

And I am surprised you commented on i2c. It is fundamentally different from USB - the device ids are fixed, or you can choose a bit at most (in hardware). There is no plug and play. Often you can't even have two devices of the same kind on the same bus. It takes half an hour to implement I2C from scratch via bit banging :-)

And ISA. Oh, ISA... It didn't have slot id-s, but it did have jumpers :-) Not to mention you could actually build an ISA board from scratch and do the decoding manually with wires... Good times.

User-friendly disk names

Posted Jun 27, 2011 3:33 UTC (Mon) by dlang (✭ supporter ✭, #313) [Link]

Ok, I've seen PCI devices get identified in different orders after a kernel update, so I assumed that part of the identification depended on the order that things are scanned.

as for USB vs i2c, if you look at the low-level over-the-wire protocol, i believe that USB is really a superset of i2c. you can bit-bang a USB interface as well, (although not very efficiently), USB adds an additional layer of software and standard definitions over the raw wire protocol.

I could be mistake, but when I first learned about USB I was looking very closely at i2c for other things and I remembering that they were extremely similar at the hardware/signaling level

User-friendly disk names

Posted Jun 27, 2011 4:12 UTC (Mon) by mikov (subscriber, #33179) [Link]

I have no doubt that you are correct about the i2c and USB similarity. If USB hubs are as dumb as you are describing, then the only way to identify a device is through some unique number (call it address, id, serial number, whatever). So you can't have two devices with the same USB serial number on the same bus. Exactly the same as i2c.

I think my point, to the extent that I even have a point beyond just being nostalgic about times when there was more direct control over hardware, is that in I2C there is no discovery. The device type is the device address. The devices and their ids are by definition fixed and known in advance. So, the question of identifying the physical location of a I2C device doesn't even exist. I2C is good for what it does.

With USB by contrast, you are identifying devices that look externally the same by a hidden magic serial number. There is a fundamental usability problem.

If I have two USB mouses which are _exactly_ the same, why do they need appear as separate devices to the computer? That makes no sense at all. If I plug them in the same PC at the same time, the only thing that really differentiates them is the USB connector.

Imagine a hypothetical product where users can interact with multiple virtual machines running on the same PC, using multiple video cards, mice and keyboards. It is pure idiocy to have to associate the keyboards and mice to the virtual machines by their unique USB serial number rather than the USB connector where they are plugged.

In other words, ideally USB hubs should have been designed to function like PCI-PCI bridges. Oh well, that is not a Linux problem :-)

User-friendly disk names

Posted Nov 8, 2011 20:13 UTC (Tue) by jo42 (subscriber, #59640) [Link]

> each serial adapter should have a unique serial number

Where can I find this serial number? I've the same problem.

# lsusb
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 009: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
Bus 003 Device 008: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
Bus 003 Device 007: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
Bus 003 Device 006: ID 0557:2008 ATEN International Co., Ltd UC-232A Serial Port [pl2303]
Bus 003 Device 005: ID 0557:2008 ATEN International Co., Ltd UC-232A Serial Port [pl2303]
Bus 003 Device 004: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
Bus 003 Device 003: ID 058f:9254 Alcor Micro Corp. Hub
Bus 003 Device 002: ID 058f:9254 Alcor Micro Corp. Hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

# diff <(lsusb -vvv -s 3:9) <(lsusb -vvv -s 3:8)
--- /proc/self/fd/11 2011-11-08 21:09:05.183873823 +0100
+++ /proc/self/fd/12 2011-11-08 21:09:05.183873823 +0100
@@ -1,5 +1,5 @@

-Bus 003 Device 009: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
+Bus 003 Device 008: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
Device Descriptor:
bLength 18
bDescriptorType 1

User-friendly disk names

Posted Nov 8, 2011 22:14 UTC (Tue) by jimparis (subscriber, #38647) [Link]

My PL2303 devices don't have a unique serial. I don't know if the
chip supports that. If your device does, then you can use the links in /dev/serial/by-id. Otherwise, the links in /dev/serial/by-path are probably your best bet.

USB Serial port woes

Posted Jun 26, 2011 16:31 UTC (Sun) by speedster1 (subscriber, #8143) [Link]

> A single multi-port USB to serial converter would address this nicely,
> but we have evaluated about a dozen of them, and while all they work
> perfectly in Windows, they are either unsupported in Linux at all,
> or horribly broken (like dropping a byte every couple of hours).
> It is an embarrassing shame. I wish our company had the resources
> to sponsor somebody to fix that.

Do they _really_ work perfectly in Windows? In my experience, cheap serial converters are prone to dropping a byte now and then, and when I searched online it turned out that it was hardware not drivers -- Windows users would experience the same problem given the same level of usage and attention to detail (it just happens a lot less often, because there are more of us Linux developers making heavy use of serial ports).

Sorry I can't find an actual reference explaining the hardware issue on a common PLX usb-serial chip; there is no sufficient replacement yet for the recently-discontinued Google Linux search :`-(

I agree that keyspan did not have these problems, but they were significantly more expensive and seem to have lost out to the even cheaper but somewhat flaky adapters...

If there are current multi-port adapters that really do have higher quality chips in them (i.e. like keyspan rather than PLX) but lack Linux drivers, then somebody should get in touch with the Linux Driver Project and donate such an adapter!
http://www.linuxdriverproject.org/

USB Serial port woes

Posted Jun 27, 2011 3:34 UTC (Mon) by mikov (subscriber, #33179) [Link]

It is difficult for me to say how good they really were in Windows, since it didn't matter. We needed them in Linux and we only did tests in Windows to make sure a specific unit wasn't defective. They definitely did behave measurably better in Windows - after comparable amount of testing there weren't any dropped bytes.

There is one additional piece of information however, which can explain at least part of what I saw:

Most of the multiport USB-to-serial adapters are in fact a USB hub with ordinary single-port adapters hanging from it. The problem is that the hub is USB 2.0 while the serial adapters themselves are USB 1.0. Linux kernels at least up to 2.6.26 had a bug where USB 1.0 devices did not work reliably behind a USB 2.0 bridge.

I have complained about this problem before on LWN and I got advice to try other config settings, which I did, but saw no improvement.

I am not 100% sure the problems were caused by this and it is also possible that it has been fixed in later kernel versions.

USB Serial port woes

Posted Jun 27, 2011 16:35 UTC (Mon) by speedster1 (subscriber, #8143) [Link]

Here is a complaint about single-port Prolific PL2303 adapters, with which I've experienced reliability issues (note I meant to say "Prolific" not "PLX" in previous comment; PLX makes perfectly good PCI bridges, not cheap USB chips). It makes the observation about dropped bytes, but doesn't have an explanation about why they are prone to occasional data loss; I think that was in a forum post not a mailing list post, and I still can't find it.

http://article.gmane.org/gmane.comp.monitoring.nut.user/5...

If your problem is instead a more generic 2.0 hub driver problem, could you post a link discussing it? With details, I might be able to go check commit messages to see if it has supposedly been fixed.

USB Serial port woes

Posted Jun 28, 2011 4:29 UTC (Tue) by mikov (subscriber, #33179) [Link]

OK, I will look for the link and post back here.

BTW, we have been using PL2303 USB-to-serial adapters and we haven't had any issues with them, as long as (important!) USB 2.0 is disabled.

User-friendly disk names

Posted Nov 3, 2011 8:46 UTC (Thu) by gebi (subscriber, #59940) [Link]

have you already looked at the ftdi 4port chips?
never had a problem with them, and we are using them a _lot_.

User-friendly disk names

Posted Nov 13, 2011 14:29 UTC (Sun) by Baylink (guest, #755) [Link]

Computone Intelliport Terminal Server.

It's TCP instead of USB, but do you really care? :-)

User-friendly disk names

Posted Jul 22, 2011 14:20 UTC (Fri) by kevinm (guest, #69913) [Link]

What would happen if we mount: /dev/disk/by-pretty/foo and some tool later thinks the pretty name should better be 'bar', it writes the name to /sys, we get a uevent, the old link disappears, we get a new link, mount has no device node anymore for the mounted device ...

Why not just return EPERM for a name change if the device is currently open (including mounted)?

Copyright © 2011, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds