VOGONS

Common searches


IMGMOUNT in Linux

Topic actions

First post, by Grunt

User metadata
Rank Newbie
Rank
Newbie

Hello, guys.
I am confused:

imgmount.png
Filename
imgmount.png
File size
15 KiB
Views
1582 views
File license
Public domain

I can mount Floppy Image without problem but device is marked as directory. Why? Is this OS bug?

Reply 3 of 20, by Caluser2000

User metadata
Rank l33t
Rank
l33t
Grunt wrote on 2020-05-11, 17:51:
Hello, guys. I am confused: imgmount.png […]
Show full quote

Hello, guys.
I am confused:
imgmount.png

I 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...😉

Reply 4 of 20, by Grunt

User metadata
Rank Newbie
Rank
Newbie
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?

Reply 5 of 20, by gdjacobs

User metadata
Rank l33t++
Rank
l33t++
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

Reply 7 of 20, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Ok, just to take a shortcut, imgmount is for image files that are not mounted by your OS.

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 8 of 20, by Grunt

User metadata
Rank Newbie
Rank
Newbie

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?

Reply 9 of 20, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

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

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 12 of 20, by Grunt

User metadata
Rank Newbie
Rank
Newbie
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?

Reply 14 of 20, by Grunt

User metadata
Rank Newbie
Rank
Newbie

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?

Reply 15 of 20, by jmarsh

User metadata
Rank Oldbie
Rank
Oldbie

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).

Reply 16 of 20, by Caluser2000

User metadata
Rank l33t
Rank
l33t

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...😉

Reply 17 of 20, by Grunt

User metadata
Rank Newbie
Rank
Newbie
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.

Reply 18 of 20, by jmarsh

User metadata
Rank Oldbie
Rank
Oldbie
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.

Reply 19 of 20, by _Rob

User metadata
Rank Member
Rank
Member

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