Re: [hatari-devel] Using device files as drive images?

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hi,

A potential issue with device file images (at least under Unix) is that
depending on the system setup (e.g. udev settings) partitions on memory
cards etc. are mounted automatically. When Hatari is started and uses a
device file with partitions that are already mounted data can be
destroyed because several programs can independently write to the same
device.
In my case as soon as I insert a memory card with 3 Atari-compatible
partitions these are mounted to /media/sdc[1-3]. When I now start Hatari
and write data to these partitions these data are only visible in
Hatari, but not in the /media/sdc[1-3] directories. Most likely when I now
write something to /media/sdc[1-3] (e.g cp command on shell level) it will
corrupt the data I've just written with Hatari before.
It would probably be a good idea for Hatari to lock device files as long
as they are in use. And not to use device files with partitions that
are mounted. I'm not sure if all these scenarios can be covered by the
locking APIs, though.

With file images there is the same problem, but in practice
auto-mounting file images is much less common than auto-mounting
removable media.

Take care

Uwe

> Hi,
> 
> > > >stat /dev/sdc
> > >   File: ‘/dev/sdc’
> > >   Size: 0               Blocks: 0          IO Block: 4096   block
> > > special file Device: 5h/5d   Inode: 2063        Links: 1     Device
> > > type: 8,20 Access: (0777/brwxrwxrwx)  Uid: (    0/    root)   Gid:
> > > (    6/    disk) Access: 2014-10-12 18:57:04.657574929 +0200
> > > Modify: 2014-10-12 18:57:04.635575204 +0200
> > > Change: 2014-10-12 18:57:25.524314059 +0200
> > >  Birth: -
> > 
> > I was finally able to re-create the problem with an USB stick. I've
> > committed a fix, please try again.
> 
> This looks much better. I can now assign a device file (memory card) on
> the command line, and can access it within Hatari without any problems.
> But when I assign a device file in the UI, after starting Hatari with
> two file images for the IDE drives, it does not work. I can replace the
> file image by a device file in the "Hard disk" dialog, but after rebooting
> Hatari I cannot access this image but always get read errors.
> 
> Take care
> 
> Uwe
> 
> 



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/