Description of problem: (reported by Evaggelos Balaskas) NTFS allows filenames up to 255 characters. The tar format seems to have a smaller limit (although not according to the documentation I'm reading so I'm not exactly sure what's going on ...) An example filename which fails: tar: ./Desktop/ΔΗΜΗΤΡΗΣ/ΣΥΝΤΕΛΕΣΤΕΣ ΑΠΟΣΒΕΣΗΣ Νέοι συντελεστές απόσβεσεις πάγιων περιουσιακών στοιχείων Οι συντελεστές απόσβεσης, ανώτεροι και κατώτεροι που προβλέπει το ΠΔ για κάθε είδος επιχειρηματικής δραστηριότητας.htm: Cannot open: File name too long Version-Release number of selected component (if applicable): libguestfs 1.19.28 Additional info: https://www.redhat.com/archives/libguestfs/2012-August/msg00028.html
Reproducer (note this command is a single line): $ guestfish -N fs:ntfs -m /dev/sda1 mkdir /Desktop : mkdir /Desktop/ΔΗΜΗΤΡΗΣ : touch "/Desktop/ΔΗΜΗΤΡΗΣ/ΣΥΝΤΕΛΕΣΤΕΣ ΑΠΟΣΒΕΣΗΣ Νέοι συντελεστές απόσβεσεις πάγιων περιουσιακών στοιχείων Οι συντελεστές απόσβεσης, ανώτεροι και κατώτεροι που προβλέπει το ΠΔ για κάθε είδος επιχειρηματικής δραστηριότητας.htm" : copy-out /Desktop .
Smaller reproducer: $ guestfish -N fs:ntfs -m /dev/sda1 mkdir /foo : touch /foo/$(perl -e 'print "Σ"x200') : copy-out /foo /tmp Note this seems to be something to do with bytes vs characters. If we use 200 ASCII characters, then the tar command works fine. If we use 200 sigma characters (in UTF 16 as used in NTFS this is 400 bytes, in UTF 8 it's also 400 bytes since each sigma is encoded as 0xCE 0xA3), then the command fails.
Changing ntfs -> ext4 causes the touch command to break, ie. such a filename cannot be created in the first place. Presumably this is because ext4 only allows filenames up to 255 *bytes* where as ntfs allows filenames up to 255 characters.
I think I'm being an idiot here. The problem is on the host side not the appliance side. Replacing copy-out with tar-out: $ guestfish -N fs:ntfs -m /dev/sda1 mkdir /foo : touch /foo/$(perl -e 'print "Σ"x200') : tar-out /foo /dev/null the command runs successfully. This indicates that the bug occurs when we create the file on the host filesystem (which being ext4 will naturally fail because the name is too long).
Likely NOTABUG, but should be documented. For a longer explanation see: https://www.redhat.com/archives/libguestfs/2012-August/msg00031.html
Fixed upstream by documentation in commit 7fa67427c6b2725bdcce52c08511f8813b7bd42e.