|↓||Skip to table of contents||↓|
|This is the talk page for discussing improvements to the Device file article.|
|WikiProject Computing / Software / Hardware||(Rated Start-class, Mid-importance)|
|The content of /dev/hda was merged into Device file on 4 November 2010. That page now redirects here. For the contribution history and old versions of the redirected page, please see ; for the discussion at that location, see its talk page.|
Character Devices can be hard drives
FreeBSD has done away with Block Devices. Some more should be written about this in the Character Device section. —Preceding unsigned comment added by 188.8.131.52 (talk) 19:52, 5 January 2010 (UTC)
I'd like to suggest a re-write please. Perhaps based on sectioning information pertaining to Linux, Windows and BSD? For example, the Windows references are not clearly differentiated here. Notice that the third sentence follows a second sentence Windows reference. Does the word "They" in the third sentence refer to Windows systems, to Unix-Linux systems or to both? Maybe references to Windows differences should appear later in the article since the article points out that Windows borrowed the concepts from Unix? Clearly set off so that people can find the system they need described? — Preceding unsigned comment added by 184.108.40.206 (talk) 01:08, 3 April 2012 (UTC)
Remove the devfs section?
The tone of voice in the devfs section is opinionated. The section is also out of place in its context. It only serves to confuse the reader, especially when the table below it makes clear that devfs is deprecated now. Gwrede (talk) 09:50, 22 April 2009 (UTC)
- Also, devfsd has its own page and this content should be merged with it and the devfs link should point to devfsd 220.127.116.11 (talk) 05:43, 8 May 2014 (UTC)
Block devices dangerous????
Article states that block devices are dangerous, what part I missed? Linux uses block devices, for example, it's the first time that I read that... — Preceding unsigned comment added by Sebelk (talk • contribs) 16:34, 1 May 2013 (UTC)
Character Devices and Block Devices
In UNIX parlance, the distinction between character and block devices is that character devices expose the properties of the underlying hardware (e.g. they may disallow reads and writes if they are not aligned to the device block size), while block devices are buffered by the system. This is somewhat counter-intuitive as it leads to character devices necessitating that you read in whole blocks, while block devices will let you read a character at a time regardless of the block size.
The current description is, therefore, wrong, and so I’m going to update it. The reason for adding this comment on the Talk page is to dissuade people from changing it back without thinking. Ajhoughton (talk) 09:49, 24 April 2014 (UTC)
- Hello there! Well, somehow you've got it quite wrong, let me quote one part of the content introduced by :
Two standard types of device files exist; unfortunately their names are, for historical reasons, rather counter-intuitive, and explanations of the difference between the two are often incorrect as a result. [...] The character device for a hard disk, for example, will normally require that all reads and writes are aligned to block boundaries and most certainly will not let you read a single byte.
- How can you have a character device for a HDD? Character and block devices got their names primarily by the amounts of data that's handled at a time by the underlying hardware device, and HDDs—as an example—internally operate with blocks of 512 bytes, or more recently with 4 KB sectors. At the same time, block devices provide permanent data storage and they're seekable, while character devices provide only "one time" actions and no data gets buffered. Thus, their names aren't counter-intuitive. See also this explanation, for example.
- In a few words, your edit is quite misleading and I'll revert it, while adding one or two references to back the previosly present content. — Dsimic (talk | contribs) 01:21, 25 April 2014 (UTC)
- No, I haven't got it wrong (it would be a surprise if I did, because I'm an expert in this area). The original article was wrong, which is why I edited it, and you're wrong too. That's why I wrote the explanation on the talk page, in the hope that someone might read it and not just immediately revert the change. It's very common to have a character device for a hard disk (for instance, on Mac OS X, the device "/dev/rdisk0" is the character device, while the device "/dev/disk0" is the block device). And you'll also note the comment about FreeBSD removing the disk block devices because they're dangerous, which means that the only disk devices on FreeBSD are character devices.
- Nor is your claim that character devices provide only "one time" actions accurate. Some character devices are seekable (and SUSv4, which I referred to, is quite clear about that; IIRC it explicitly states that character devices other than terminal devices may be seekable). The only distinction is that block devices are buffered and don't expose hardware behaviour (like the underlying block size), whereas character devices are unbuffered and do expose hardware behaviour.
- So, "in a few words", your revert is incorrect, your claims are incorrect, and I'm going to change it back again. Ajhoughton (talk) 20:25, 25 April 2014 (UTC)
- The fact that BSDs treat them differently isn't the reason to present that as the only interpretation of character vs. block device meaning, while the old content of the article covers both interpretations. I'm not going to argue with you, and even less to go into edit warring. Feel free to revert and leave it for other editors to weigh in.
- By the way, just have a look at this quote from the "block devices are bad" explanation:
The caching will reorder the sequence of write operations, depriving the application of the ability to know the exact disk contents at any one instant in time.
- Isn't that what write barriers are there for? Sure, it's much simpler to ditch buffering than to implement write barriers. — Dsimic (talk | contribs) 02:38, 26 April 2014 (UTC)
- It isn't that “BSDs treat them differently”, it’s that the name “character special file” comes from UNIX, so what is relevant here is what the Single UNIX Specification says, which unsurprisingly corresponds with the behaviour and documentation of System V and BSD UNIXen. Linux may very well be different — but Linux is not UNIX, and the distinction between character and block devices is not really present on other systems.
- As for the comment from the FreeBSD documentation, you're right that write barriers improve matters for users of block devices, but they don't solve the problem of other software using character devices at the same time that you're using block devices to access the same underlying hardware. Ajhoughton (talk) 16:47, 29 April 2014 (UTC)
- Well, Linux is different and it's here running on numerous computers and whatnot, so describing its behavior as well should be required in order for WP:NPOV to be maintained; the article isn't strictly only about device files in certified Unices. — Dsimic (talk | contribs) 17:45, 29 April 2014 (UTC)