bug-parted
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems with DISK IMAGING


From: Andrew Clausen
Subject: Re: Problems with DISK IMAGING
Date: Tue, 14 Nov 2000 15:58:26 +1100

address@hidden wrote:
> 
> Dear developers of parted,
> 
> today I started playing around with parted-1.2.13 to create disk images. I
> found the following problems:
> 
> 1. The documentation says a Windows partition in the disk image can be
> created with:
> 
>         # parted /root/cdimage/diskimage mklabel msdos mkpart primary fat 0
> 640
> 
>    This leads to an error message. The statement works if you say:
> 
>         # parted /root/cdimage/diskimage mklabel msdos mkpart primary fat 0
> 639
> 
> 2. If you try to copy a disk image from a CD to the disk parted fails,
> because it tries to open the disk image on CD in readwrite mode. Instead it
> should have a second attempt and try to open the image readonly. I made the
> following change to work with disk images on CD. Maybe there should be an
> additional warning that the device has been opened read only.
> 
> static int
> _do_open (PedDevice* dev)
> {
>      dev->fd = open (dev->path, O_RDWR);
>      if (dev->fd == -1) {
>        dev->fd = open (dev->path, O_RDONLY);
>        if (dev->fd == -1) {
> 
>          ped_exception_throw (
>                      PED_EXCEPTION_ERROR,
>                      PED_EXCEPTION_CANCEL,
>                      "Error opening %s: %s",
>                      dev->path, strerror (errno));
>          return 0;
>        }
>      }
> 
> #ifdef linux
>      _flush_cache (dev);
> #endif
> 
>      return 1;
> }

Thanks a lot for your advice!  That's what happens when you
don't have a burner try it out :-(

Andrew Clausen



reply via email to

[Prev in Thread] Current Thread [Next in Thread]