Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

0 votes
1 answers
588 views
I can't create a character device inside of /dev/pts/ even as root
``` sudo mknod /dev/pts/mytty c 0 9 ``` > mknod: /dev/pts/mytty: Operation not permitted How come I cannot create a character device file in this directory?
sudo mknod /dev/pts/mytty c 0 9
> mknod: /dev/pts/mytty: Operation not permitted How come I cannot create a character device file in this directory?
Huzi (462 rep)
Dec 6, 2021, 05:11 AM • Last activity: Jan 11, 2024, 05:00 PM
3 votes
2 answers
1206 views
Why to use udev rule to insure persistent naming/permission instead of mknod?
I have seen some configurations using `udev rule` to insure the disk name and permissions in the disk. But recently I've find out a command called `mknod`, where it works like an alias to the block device, by specify the `major:minor` of the disk, we can "create an alias", something like it: [root@d...
I have seen some configurations using udev rule to insure the disk name and permissions in the disk. But recently I've find out a command called mknod, where it works like an alias to the block device, by specify the major:minor of the disk, we can "create an alias", something like it: [root@dbnode1 disks]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sdd 8:48 0 160M 0 disk mknod /disks/QUORUML b 8 48 Now I'd like to know why to use udev rules instead of mknod, since mknod is very simple to use. My main point is insure persistent naming and permission.
Astora (509 rep)
Jun 25, 2022, 08:09 PM • Last activity: Jun 25, 2022, 09:00 PM
0 votes
1 answers
230 views
Dumb terminal agetty keyboard layout filter
I recently acquired an old Heathkit dumb terminal, and I would like to get it working with the colemak keyboard layout. Because the terminal sends ascii codes directly over serial, I don't believe anything like `loadkeys` will work. (If there *is* a simple solution to changing the layout, I'd love t...
I recently acquired an old Heathkit dumb terminal, and I would like to get it working with the colemak keyboard layout. Because the terminal sends ascii codes directly over serial, I don't believe anything like loadkeys will work. (If there *is* a simple solution to changing the layout, I'd love to know.) My current plan is to filter every byte that is received or transmitted in a simple piece of software. There are also a few command line programs that still use incompatible escape codes (despite TERM being set correctly) which I would like to manually filter out as well. Essentially I'd like to create a program that sits between agetty and the terminal and allows me to filter bytes manually as they are sent or received. The filtering of bytes is simple enough, but I'm unsure how to create an interface to agetty that can do this. Will I need to create my own device using mknod? (I've also considered using a microcontroller or raspberry pi sitting between the terminal and linux machine to read bytes in and write the new bytes out. This solution would be clunky and I'd like to avoid it if possible.) Any advice on where to look/read would be extremely helpful.
runrin (31 rep)
Jun 12, 2022, 10:13 PM • Last activity: Jun 13, 2022, 06:08 AM
3 votes
1 answers
3605 views
Docker: bash: /dev/null: Permission denied
I use docker to unpack a linux chroot and then execute commands into it, but I get this inside the chroot. echo ciao > /dev/null bash: /dev/null: Permission denied I thought that the null device must be corrupted so I tried something else: rm -f /dev/null ; mknod -m 0666 /dev/null c 1 3; echo ciao >...
I use docker to unpack a linux chroot and then execute commands into it, but I get this inside the chroot. echo ciao > /dev/null bash: /dev/null: Permission denied I thought that the null device must be corrupted so I tried something else: rm -f /dev/null ; mknod -m 0666 /dev/null c 1 3; echo ciao > /dev/null bash: /dev/null: Permission denied But it also did not work. Doing stat on the main /dev/null and the one inside the chroot showed no difference at all. I am writing this because it seems I was the first person in the writing about this problem.
LtWorf (161 rep)
May 15, 2020, 01:50 PM • Last activity: Jan 16, 2022, 12:01 PM
1 votes
0 answers
846 views
How to mount device that appears in /proc/devices but not /dev?
I'm using a bare bones Linux distribution running on a Phytec i.MX6 ULL SoM on the Phytec demo board for this SoM. I need to be able to copy a file from an SD card. I flashed the SoM NAND from an SD card in the demo board SD card slot so I know the SD card hardware is good. Now I'm booting from the...
I'm using a bare bones Linux distribution running on a Phytec i.MX6 ULL SoM on the Phytec demo board for this SoM. I need to be able to copy a file from an SD card. I flashed the SoM NAND from an SD card in the demo board SD card slot so I know the SD card hardware is good. Now I'm booting from the NAND and attempting to read from the SD card after the OS boots. When I boot up, there is no mmc* device in dev: $ ls -l /dev | grep mmc (no result) However the SD card is apparently visible via /proc/devices: $ cat /proc/devices . . . Block devices: . . . 179 mmc . . . Is there a way I can create an entry in /dev from the /proc/devices data? Based on Googling I suspect I should use the mknod command but I can't work how. -- Edit -- Darn, I thought I had it figured out for a second. Based on this https://programmer.group/manual-creation-of-device-nodes-under-dev-in-linux.html I did: mknod /dev/mmcblk0 b 179 0 mknod /dev/mmcblk0p1 b 179 1 mount /dev/mmcblk0p1 /mnt/ But I get the error: mount: /mnt: /dev/mmcblk0p1 is not a valid block device. -- Edit2 -- @user414777 If I do: ls /sys/block I get loop0@ loop3@ loop6@ mtdblock1@ mtdblock4@ ram10@ ram13@ ram2@ ram5@ ram8@ loop1@ loop4@ loop7@ mtdblock2@ ram0@ ram11@ ram14@ ram3@ ram6@ ram9@ loop2@ loop5@ mtdblock0@ mtdblock3@ ram1@ ram12@ ram15@ ram4@ ram7@ There is no mmc in my /sys/block I'm going to read up on devtmpfs as I'm not familiar with that. -- Edit3 -- Here are my /dev/block and /sys/dev/ block contents: $ ls -l /dev/block lrwxrwxrwx 1 root root 7 Jan 1 00:16 1:0 -> ../ram0 lrwxrwxrwx 1 root root 7 Jan 1 00:16 1:1 -> ../ram1 lrwxrwxrwx 1 root root 8 Jan 1 00:16 1:10 -> ../ram10 lrwxrwxrwx 1 root root 8 Jan 1 00:16 1:11 -> ../ram11 lrwxrwxrwx 1 root root 8 Jan 1 00:16 1:12 -> ../ram12 lrwxrwxrwx 1 root root 8 Jan 1 00:16 1:13 -> ../ram13 lrwxrwxrwx 1 root root 8 Jan 1 00:16 1:14 -> ../ram14 lrwxrwxrwx 1 root root 8 Jan 1 00:16 1:15 -> ../ram15 lrwxrwxrwx 1 root root 7 Jan 1 00:16 1:2 -> ../ram2 lrwxrwxrwx 1 root root 7 Jan 1 00:16 1:3 -> ../ram3 lrwxrwxrwx 1 root root 7 Jan 1 00:16 1:4 -> ../ram4 lrwxrwxrwx 1 root root 7 Jan 1 00:16 1:5 -> ../ram5 lrwxrwxrwx 1 root root 7 Jan 1 00:16 1:6 -> ../ram6 lrwxrwxrwx 1 root root 7 Jan 1 00:16 1:7 -> ../ram7 lrwxrwxrwx 1 root root 7 Jan 1 00:16 1:8 -> ../ram8 lrwxrwxrwx 1 root root 7 Jan 1 00:16 1:9 -> ../ram9 lrwxrwxrwx 1 root root 12 Jan 1 00:16 31:0 -> ../mtdblock0 lrwxrwxrwx 1 root root 12 Jan 1 00:16 31:1 -> ../mtdblock1 lrwxrwxrwx 1 root root 12 Jan 1 00:16 31:2 -> ../mtdblock2 lrwxrwxrwx 1 root root 12 Jan 1 00:16 31:3 -> ../mtdblock3 lrwxrwxrwx 1 root root 12 Jan 1 00:16 31:4 -> ../mtdblock4 lrwxrwxrwx 1 root root 8 Jan 1 00:16 7:0 -> ../loop0 lrwxrwxrwx 1 root root 8 Jan 1 00:16 7:1 -> ../loop1 lrwxrwxrwx 1 root root 8 Jan 1 00:16 7:2 -> ../loop2 lrwxrwxrwx 1 root root 8 Jan 1 00:16 7:3 -> ../loop3 lrwxrwxrwx 1 root root 8 Jan 1 00:16 7:4 -> ../loop4 lrwxrwxrwx 1 root root 8 Jan 1 00:16 7:5 -> ../loop5 lrwxrwxrwx 1 root root 8 Jan 1 00:16 7:6 -> ../loop6 lrwxrwxrwx 1 root root 8 Jan 1 00:16 7:7 -> ../loop7 $ ls -l /sys/dev/block lrwxrwxrwx 1 root root 0 Jan 1 00:17 1:0 -> ../../devices/virtual/block/ram0/ lrwxrwxrwx 1 root root 0 Jan 1 00:17 1:1 -> ../../devices/virtual/block/ram1/ lrwxrwxrwx 1 root root 0 Jan 1 00:17 1:10 -> ../../devices/virtual/block/ram10/ lrwxrwxrwx 1 root root 0 Jan 1 00:17 1:11 -> ../../devices/virtual/block/ram11/ lrwxrwxrwx 1 root root 0 Jan 1 00:17 1:12 -> ../../devices/virtual/block/ram12/ lrwxrwxrwx 1 root root 0 Jan 1 00:17 1:13 -> ../../devices/virtual/block/ram13/ lrwxrwxrwx 1 root root 0 Jan 1 00:17 1:14 -> ../../devices/virtual/block/ram14/ lrwxrwxrwx 1 root root 0 Jan 1 00:17 1:15 -> ../../devices/virtual/block/ram15/ lrwxrwxrwx 1 root root 0 Jan 1 00:17 1:2 -> ../../devices/virtual/block/ram2/ lrwxrwxrwx 1 root root 0 Jan 1 00:17 1:3 -> ../../devices/virtual/block/ram3/ lrwxrwxrwx 1 root root 0 Jan 1 00:17 1:4 -> ../../devices/virtual/block/ram4/ lrwxrwxrwx 1 root root 0 Jan 1 00:17 1:5 -> ../../devices/virtual/block/ram5/ lrwxrwxrwx 1 root root 0 Jan 1 00:17 1:6 -> ../../devices/virtual/block/ram6/ lrwxrwxrwx 1 root root 0 Jan 1 00:17 1:7 -> ../../devices/virtual/block/ram7/ lrwxrwxrwx 1 root root 0 Jan 1 00:17 1:8 -> ../../devices/virtual/block/ram8/ lrwxrwxrwx 1 root root 0 Jan 1 00:17 1:9 -> ../../devices/virtual/block/ram9/ lrwxrwxrwx 1 root root 0 Jan 1 00:17 31:0 -> ../../devices/soc0/soc/1806000.gpmi-nand/mtd/mtd0/mtdblock0/ lrwxrwxrwx 1 root root 0 Jan 1 00:17 31:1 -> ../../devices/soc0/soc/1806000.gpmi-nand/mtd/mtd1/mtdblock1/ lrwxrwxrwx 1 root root 0 Jan 1 00:17 31:2 -> ../../devices/soc0/soc/1806000.gpmi-nand/mtd/mtd2/mtdblock2/ lrwxrwxrwx 1 root root 0 Jan 1 00:17 31:3 -> ../../devices/soc0/soc/1806000.gpmi-nand/mtd/mtd3/mtdblock3/ lrwxrwxrwx 1 root root 0 Jan 1 00:17 31:4 -> ../../devices/soc0/soc/1806000.gpmi-nand/mtd/mtd4/mtdblock4/ lrwxrwxrwx 1 root root 0 Jan 1 00:16 7:0 -> ../../devices/virtual/block/loop0/ lrwxrwxrwx 1 root root 0 Jan 1 00:16 7:1 -> ../../devices/virtual/block/loop1/ lrwxrwxrwx 1 root root 0 Jan 1 00:16 7:2 -> ../../devices/virtual/block/loop2/ lrwxrwxrwx 1 root root 0 Jan 1 00:16 7:3 -> ../../devices/virtual/block/loop3/ lrwxrwxrwx 1 root root 0 Jan 1 00:16 7:4 -> ../../devices/virtual/block/loop4/ lrwxrwxrwx 1 root root 0 Jan 1 00:16 7:5 -> ../../devices/virtual/block/loop5/ lrwxrwxrwx 1 root root 0 Jan 1 00:16 7:6 -> ../../devices/virtual/block/loop6/ lrwxrwxrwx 1 root root 0 Jan 1 00:16 7:7 -> ../../devices/virtual/block/loop7/ I don't seem to have a /sys/dev/block/179:0
cdahms (131 rep)
Feb 12, 2021, 03:35 AM • Last activity: Feb 12, 2021, 04:15 AM
2 votes
1 answers
2556 views
What does mknod do?
So the `mknod` command, what does that do? /dev/random$ mknod -m 666 random c 1 8 I understand that `-m` specifies permissions, and that `mknod` overall create an `inode` in the filesystem which can be a file, directory, device, fifo, etc...but I really don't understand what the last 3 arguments the...
So the mknod command, what does that do? /dev/random$ mknod -m 666 random c 1 8 I understand that -m specifies permissions, and that mknod overall create an inode in the filesystem which can be a file, directory, device, fifo, etc...but I really don't understand what the last 3 arguments there do.
leeand00 (4939 rep)
Jan 15, 2020, 10:26 PM • Last activity: Jan 15, 2020, 10:38 PM
Showing page 1 of 6 total questions