0

all! So I've been sleuthing over this problem for the past two days.

I have a ramdisk, and I tried partitioning it using both parted and fdisk. I also tried to register it using partprobe and kpartx.

lsblk is displaying the partition I made for cow_ram0 as cow_ram0p1. However, the /dev/cow_ram0p1 file doesn't exist.

Has anyone experienced this before? If so, how'd you solve it?

It doesn't even have to be ramdisk specific. Has anyone ever had the /dev/ file not appear upon partitioning?


Now, for some details (don't want to get downvoted to oblivion):

The ramdisk is called cow_ram0. So I tried this first:
fdisk /dev/cow_ram0
I hit n for new partition.
Then, I just hit enter twice to get the first sector number at 2048 and the last one at whatever the last sector is.
Then I hit w to write all these actions.

Then I called lsblk. I don't see a partition for the ramdisk.
So I call partprobe and then kpartx -u /dev/cow_ram0 (calling both because partprobe didn't work, and ayy... I am looking into an Issue, so this won't go to master... redundancy won't hurt).
Now the lsblk output actually contains cow_ram0p1.
So I try to mount it, and I get a /dev/cow_ram0p1 file doesn't exist error.
I repeat the process above with parted -a opt /dev/cow_ram0 -t ext4 primary 0% 100% instead of the fdisk stuff above. Same result. Has anyone experienced this before?

Yolo Voe
  • 484
  • 8
  • 22
  • Wrong site. You're looking for [unix.se] or [su] instead. This site is for programming related questions, not general OS or computer support. – Ken White Oct 05 '17 at 02:44
  • Apologies. I am doing this in C, but I guess that doesn't make a difference. Thanks. – Yolo Voe Oct 05 '17 at 02:51
  • If it doesn't contain code, it's not a programming question. I don't see any indication of code anywhere in your post. Looks like it's all OS terminal commands. Did I miss something? – Ken White Oct 05 '17 at 02:52
  • You're right! It's open-sourced. I'll post it on Unix&Linux, but here's the code if you're interested: https://github.com/utsaslab/crashmonkey/blob/master/code/harness/Tester.cpp#L403 – Yolo Voe Oct 05 '17 at 02:55

1 Answers1

0

Ok. The problem was I had forgotten to set a flag(max_part) in the kernel module when inserting it. Hopefully you, the reader, made the same mistake.

Yolo Voe
  • 484
  • 8
  • 22