How do I use udev to mount my filesystem?
by DapperDeer from LinuxQuestions.org on (#55XJM)
Hello
I have a 5.4.50 Linux Kernel that I am using for a secure boot chain for my work. I am writing an init script that runs in the initramfs that does some verification of the filesystem. My script originally created block device nodes via mknod, but recently for some reason, although the node creation is successful, I'm unable to touch the disks via dd.
Code:MountProc() {
mount /proc
}
MakeNodes() {
mknod /dev/sda b 8 0
mknod /dev/sda1 b 8 1
mknod /dev/sda2 b 8 2
mknod /dev/sda3 b 8 4
mknod /dev/sda4 b 8 4
}Was generally enough to let me do what I needed, but for some reason this has become inadequate and so I'm trying to take it as an opportunity to do this the - what I believe to be - "right way".
My fstab currently only mounts /dev/sda4 as that is my kernel and I shouldn't need to mount anything else.
I understand that udev uses "rules" of some kind but I'm not sure if that's what I need for automatic disk/device node(?) creation.
Any advice would be appreciated!
Thanks


I have a 5.4.50 Linux Kernel that I am using for a secure boot chain for my work. I am writing an init script that runs in the initramfs that does some verification of the filesystem. My script originally created block device nodes via mknod, but recently for some reason, although the node creation is successful, I'm unable to touch the disks via dd.
Code:MountProc() {
mount /proc
}
MakeNodes() {
mknod /dev/sda b 8 0
mknod /dev/sda1 b 8 1
mknod /dev/sda2 b 8 2
mknod /dev/sda3 b 8 4
mknod /dev/sda4 b 8 4
}Was generally enough to let me do what I needed, but for some reason this has become inadequate and so I'm trying to take it as an opportunity to do this the - what I believe to be - "right way".
My fstab currently only mounts /dev/sda4 as that is my kernel and I shouldn't need to mount anything else.
I understand that udev uses "rules" of some kind but I'm not sure if that's what I need for automatic disk/device node(?) creation.
Any advice would be appreciated!
Thanks