Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I needed to back-up on DVD a directory with a huge mess of files and symlinks. I don't have write access to that directory.

I have created the DVD image from GNU/Linux enabling rock-ridge and joliet extensions with the following command:

genisoimage -r -J -joliet-long -T -o mess.iso mess/

The result is fine.

Now I need to access the DVD from Windows XP but all the symlinks appear to be dangling (they are shown as 0 size files). As far as I understood, this is because symlinks are handled by the rockridge extension and Windows XP is not capable of using it.

Is there something that can be installed to properly access that DVD? A custom file manager would be an option too. I can also remaster the image with different options, if that helps.

share|improve this question
    
I don't know if this is going to work, but you can consider using the UDF file system, which supports symlinks and is more modern. –  Pincopallino Apr 4 '13 at 8:52
    
@Pincopallino IIRC Windows XP does not support UDF, so I did not consider that option. Of course if it can be worked out I can choose that way... –  ntd Apr 4 '13 at 11:15
    
Windows XP supports UDF 1.02, 1.5 and 2.01 and maybe even newer versions with some drivers or tweaking. –  Pincopallino Apr 4 '13 at 11:36
    
I'm still not sure how would Linux symlinks be converted to UDF symlinks and if the result is readable in Windows. –  Pincopallino Apr 4 '13 at 11:43
    
@Pincopallino Thanks for your suggestion. I tried your way (not that hard though) but I found the UDF support on Linux is a bit messy (support for UDF in mkisofs was alpha, online doc lacking). So I solved with a different approach. –  ntd Apr 9 '13 at 9:36

2 Answers 2

up vote 1 down vote accepted

Eureka! I have been able to accomplish what requested.

First of all I converted all the symbolic links to hard links. I created a script like the following one:

#!/bin/sh

link="$1"

error() {
    echo "Error: $1." 1>&2
    exit 1
}

[ -h "$link" ] || error "'$link' is not a symbolic link"

linkdir=`dirname "$link"`
linkname=`basename "$link"`
target=`cd "$linkdir" 2> /dev/null && readlink -qfn "$linkname"`
[ $? = 0 ] || error "unable to readlink '$link'"

[ -f "$target" ] || error "'$link' target is not a regular file"

ln -f "$target" "$link" || error "hard-link failed on '$link'"

and executed it under the mess directory:

find . -type l -print0 | xargs -0n1 soft2hard.sh

After that I created the ISO image in the same way as before, but ensuring --cache-inode was used (I also omitted -T to reduce clutter):

genisoimage -r -J -joliet-long --cache-inodes -o mess.iso mess/

And voilà: everything is perfectly accessible from Windows XP and fits a low-density DVD.

share|improve this answer

The symlinks appear in the iso as links to a foreign file system that Windows cannot handle.

For a CD format that is more independent of the operating-system, you should use in genisoimage the -f parameter to dereference the symlinks or follow them rather than entering them using Rock Ridge.

This way you add the target of the symlink to the ISO image rather than the symlink itself. The file will appear in the directory structure in place of the symlink.

The article CD Writing Howto has a good explanation of the problem, although it uses mkisofs rather than genisoimage.

[EDIT]

If you were targeting Vista/7/8 rather than XP, you could backup without the symlinks and restore on NTFS. Then create on Linux a Windows batch script that will create the equivalent NTFS symbolic links.
However, XP only supports links to folders, not files.

For more info see NTFS reparse point and a useful Windows utility is Junction.

In any case, a DVD in Windows can have no symbolic links, so you need to restore on NTFS for that.

share|improve this answer
    
As I never used both commands, I do hope that -f on genisoimage works the same way as in mkisofs, as the man page is not very clear. –  harrymc Apr 4 '13 at 10:36
    
Actually the image size is 4 Gb: if I follow symlinks it will be 14 Gb. I was hoping on a custom file manager for XP that can handle them... –  ntd Apr 4 '13 at 11:08
    
genisoimage was initially a rename of mkisofs made by Debian for supposed licensing issues, so it should be a drop-in replacement –  ntd Apr 4 '13 at 11:10
    
Are the symlinks already included in the iso (ie. is it self-contained)? I'll try to think of a solution, but first a question: Is it possible to transfer the 14 GB iso as file chunks on several DVDs and combine the chunks and mount the iso (as iso) on Windows ? –  harrymc Apr 4 '13 at 11:16
    
Yes, the symlinks are all relative paths resolved inside the DVD tree. Burning it in different DVDs is not an option: it would involve too much manual tinkering... –  ntd Apr 4 '13 at 11:22

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.