Tag Info

Hot answers tagged

46

One reason is that block level access is a bit lower level than ls would be able to work with. /dev/cdrom, or dev/sda1 may be your CD ROM drive and partition 1 of your hard drive, respectively, but they aren't implementing ISO 9660 / ext4 - they're just RAW pointers to those devices known as Device Files. One of the things mount determines is HOW to use ...


12

Basically, and to put it easily, the operating system needs to know how to access the files on that device. mount is not only "giving you access to the files", it's telling the OS the filesystem the drive has, if it's read only or read/write access, etc. /dev/cdrom is a low-level device, the operating system functions wouldn't know how to access them... ...


6

For consistency Imagine you have some partitions on the first hard drive in your system. For example, /dev/sda2. You later decide that the drive isn't large enough so you purchase a second one and add it to the system. All of a sudden, that becomes /dev/sda and your current drive becomes /dev/sdb. Your partition is now /dev/sdb2. Using your proposed ...


5

There are several advantages to the current arrangement. They can be grouped into advantages of block special files and advantages of mountpoints. Special files are files that represent devices. One of the Ideas that unix was built on is everything is a file. This makes many things simple, for example user interaction is just file reads and writes on a tty ...


3

I'd call it historical reasons. Not that the other answers are wrong, but there's a bit more to the story. Compare Windows: Windows started as a single-computer, single-user OS. That single computer probably had one floppy drive and one hard drive, no network connection, no USB, no nothing. (Windows 3.11 had native networking capabilities; Windows 3.1 ...


3

Many database engines can work directly with raw disks or partitions. For example, MySQL: http://dev.mysql.com/doc/refman/5.7/en/innodb-raw-devices.html This avoids the overhead of going through filesystem drivers, when all the DB engine really needs is one huge file that fills the disk.


3

I think about this in the following manner: mount is a tool that tells the system to interpret the contents of some files as directory trees. The filesystem has directories and files, and each file is a label for some string of bytes. /dev/cdrom is a file, it represents the string of bytes stored on the CD. You can read this very long string directly, but ...


3

Your shell, or whatever process was in the foreground, was already reading the terminal to which is was attached, which was /dev/ttys011. Then you started another process, a cat also reading the same terminal at the same time. Now there are two processes competing for the same input from the terminal. Each time you type a key in the terminal, it is ...


2

It's not really possible to make a device without the help of the kernel (by writing your own kernel driver module); although there is FUSE, and lesser known and not commonly supported CUSE for character devices in user space, and NBD could be used for block devices. If it's sufficient to be similar, you could use named pipes using mkfifo and then have some ...


1

Neither udev nor DKMS can be adequately described as “a way to dynamically manage all connected/disconnected device drivers on a Linux system”. Udev dynamically manages devices, not drivers — it creates entries in /dev when a device is plugged in. DKMS is about drivers, but it has nothing to do with locating a driver for a device: it's a way to compile ...


1

AFAIK device files are the only option for userland processes to get access to devices. The kernel doesn't care whether that process is a shell. C programs have an option for fine-tuning the device access: the ioctl call: man 2 ioctl: int ioctl(int d, unsigned long request, ...); Maybe there is a shell wrapper for that but I am not aware of any. > ...


1

The question title asks: Why do we need to mount on Linux? One way to interpret this question: Why do we need to issue explicit mount commands to make file systems available on Linux? The answer: we don't. You don't need to mount file systems explicitly, you can arrange for it to be done automatically, and Linux distributions already do this for most ...


1

Because /dev/cdrom is a device, whereas /media/cdrom is a filesystem. You need to mount the former on the latter in order to access the files on the CD-ROM. Your operating system is already automatically mounting the root and user filesystems from your physical hard disk device, when you boot your computer. This is just adding more filesystems to use. All ...


1

If you do: mount -t type /dev/somedev /dir/somedir you mount the device file somedev on the directory somedir. somedir is and stays a directory, the access to the device "redirects" via the mount point to the somedev device. To answer your second question ( have corresponding device file somewhere) directly: yes it does it is somedev that you use for ...


1

For me it was the baudrate too low. Output did appear once I reconfigured the system (device and port) to use 300 instead of 150.



Only top voted, non community-wiki answers of a minimum length are eligible