First post, by Grunt
- Rank
- Newbie
Hello, guys.
I am confused:
I can mount Floppy Image without problem but device is marked as directory. Why? Is this OS bug?
Hello, guys.
I am confused:
I can mount Floppy Image without problem but device is marked as directory. Why? Is this OS bug?
Mount and Imgmount are different commands.
But /dev/sdb isn't directory. It is file.
Grunt wrote on 2020-05-11, 17:51:Hello, guys. I am confused: imgmount.png […]
Hello, guys.
I am confused:
imgmount.pngI can mount Floppy Image without problem but device is marked as directory. Why? Is this OS bug?
First you need to understand how linux, or for that matter *nix workalike OSs, functions then you will have found the answer to this question. Any old *nix book will do.
There's a glitch in the matrix.
A founding member of the 286 appreciation society.
Apparently 32-bit is dead and nobody likes P4s.
Of course, as always, I'm open to correction...😉
Caluser2000 wrote on 2020-05-11, 18:08:First you need to understand how linux, or for that matter *nix workalike OSs, functions then you will have found the answer to this question. Any old *nix book will do.
Now I'm confused even more. Should I try loop device?
Grunt wrote on 2020-05-11, 18:04:But /dev/sdb isn't directory. It is file.
/dev/sdb is a file pointing to a device
All hail the Great Capacitor Brand Finder
Yes.
Ok, just to take a shortcut, imgmount is for image files that are not mounted by your OS.
Which is exactly what I want. /dev/sdb is floppy device. I don't want to use system mounting because caching, I want direct mount from Dosbox.
dd if=/dev/sdb of=/tmp/image.img works perfectly. IMGMOUNT /dev/sdb - file is not a file but directory. What?
It's a floppy DEVICE not an IMAGE. IMGMOUNT is for IMAGES. NOT for devices.
The dd command makes an image of the device which, as it is now an image, of course works.
Try
Mount a /dev/sdb -t floppy
What? /dev/sdb is block device. MOUNT is for directories. Am I wrong?
You can only imgmount regular files, not devices.
jmarsh wrote on 2020-05-11, 18:50:You can only imgmount regular files, not devices.
Oh, thanks. That is explenation. Ok and equivalent of MOUNT A A: -t floppy in Linux exists?
You'd have to mount it somewhere in the native linux filesystem (e.g. /mnt/floppy) and then mount that directory inside DOSBox ("mount a /mnt/floppy -t floppy").
So short answer: No, no equivalent for direct manipulation with device.
Why it is problem? Work with block device is just as work with regular file. Seeking, reading, writing. It should work. It is safe just to comment checking macro?
It's not the same. Block devices have stricter requirements regarding read/write sizes and offsets, may require explicit seeks... there's no guarantee the C library will take care of that correctly if you use the buffered I/O functions (which DOSBox does).
I thought fd0 was the block device for floppies. Not that I'm an expert or anything...
There's a glitch in the matrix.
A founding member of the 286 appreciation society.
Apparently 32-bit is dead and nobody likes P4s.
Of course, as always, I'm open to correction...😉
jmarsh wrote on 2020-05-11, 19:24:It's not the same. Block devices have stricter requirements regarding read/write sizes and offsets, may require explicit seeks... there's no guarantee the C library will take care of that correctly if you use the buffered I/O functions (which DOSBox does).
Hmm. There should be warning in DOSBox Wiki or something. First thing I'm going to do when I pull out the old rusty harddrive/FDD is to IMGMOUNT it Linux. Just to be safe.
And you know what? It quite sucks. There is plenty of tool for Windows but just mount.vfat for Linux. Shouldn't be at least loop device (img)mountable?
Caluser2000 wrote on 2020-05-11, 19:26:I thought fd0 was the block device for floppies. Not that I'm an expert or anything...
It is. If you own FDC. I have SCSI device so it is under /dev/sdX.
Grunt wrote on 2020-05-12, 18:28:First thing I'm going to do when I pull out the old rusty harddrive/FDD is to IMGMOUNT it Linux. Just to be safe.
That's not safe at all. The safest thing to do is make an image and mount a copy to keep the original data pristine.
And you know what? It quite sucks. There is plenty of tool for Windows but just mount.vfat for Linux.
You can't imgmount a physical floppy drive under windows either. You can only mount the drive letter as a directory, which is the same as under linux; accessing the underlying filesystem is handled by the OS in both cases.
Normally on linux the floppy drive would be /dev/fd0 and is a so-called "block device". It should not be too difficult to implement support for it in DOSBox, but nobody has until now, and considering how rare such setups are nowadays means it probably never will. The openMSX emulator for instance can directly access a floppy drive on Linux.
Your however using /dev/sdb, which to me means it is not a real floppy drive. But probably a USB Floppy Drive, which uses a completely different protocol called UFI. Under Linux you have for instance "ufiformat" for formatting a diskette in a USB floppy drive. You can also query the supported formats as follows (with a 720kB DD disk in the drive):
sudo ufiformat -i /dev/sdb
vendor: TEAC
product: FD-05PUB
write protect: off
media type: 2DD
status block size kb
formatted 1440 512 720
formattable 1440 512 720