How can I use a loop device as the DATAFILE?

Help
2008-04-10
2013-04-30
  • Philip Smith
    Philip Smith
    2008-04-10

    Using a toc-file like this:

    CD_ROM
    TRACK MODE1
    DATAFILE "/dev/loop/0"

    I get an error message like this:

    ERROR: Track 1: Requested length for data file "/dev/loop/0" is 0.

    If I then specify the size of the loop device, like this:

    CD_ROM
    TRACK MODE1
    DATAFILE "/dev/loop/0" 681574400

    I get an error message like this:

    ERROR: Track 1: Requested length (681574400 bytes) exceeds length of file "/dev/loop/0" (0 bytes at offset 0).

    I believe this is happening because the loop device doesn't work with stat() to reveal its size.  I think the only way you can find the size is to open the device, seek to its end, then read the file position pointer. 

    Is there some way I can get cdrdao to burn the contents of the loop device without first copying them into a file?  (The loop device points to a segment of a disk partition, so there's no file behind it I could use instead.)