|Re: [hatari-devel] Using device files as drive images?|
[ Thread Index |
| More lists.tuxfamily.org/hatari-devel Archives
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [hatari-devel] Using device files as drive images?
- From: Uwe Seimet <Uwe.Seimet@xxxxxxxxx>
- Date: Mon, 13 Oct 2014 19:06:38 +0200
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1413219998; l=2207; s=domk; d=seimet.de; h=In-Reply-To:Content-Transfer-Encoding:Content-Disposition: Content-Type:MIME-Version:References:Subject:To:From:Date; bh=jUD4KlpsfnRolrjd7ST+TnQDgt8=; b=DngMpHXpZGY948Fx6Ksu+3jNvNwUAgIv1yZDEfloJaTd/7d3B/UjlvuRUFyRyvCSuoM cOtadiJrY/3gyIJ8T4RbanvyUO2kG2w/l5Ji61PospoAzZJyOk8UuvK4OvGz0Tw8d0Wo9 NU44aV+Xw0YQ0YrjPa3vywfUUJg+VkLhy/4=
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
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
> > > >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