1

We've got an old system with a write protected (qstar tape) filesystem on it and I'm trying to copy all the files off there before it's canned.

CentOS release 6.9 (Final) - 2.6.32-696.23.1.el6.x86_64

I'm unsure how the files got on here like this in the first place, but they are listing as this when I do ls -l:

??????????? ? ?    ?             ?            ? Item from 23"2"60 with special chars.xml

If it was just the spaces, it would be fine, but the " marks seem to be really causing all sort of bother. Also because of the read only file system (tapes) I can't just rename the file in situ.

If I try an ls (I get the same if I escape the " too)

# ll Item\ from\ 23"2"60\ with\ special\ chars.xml
ls: cannot access Item from 23"2"60 with special chars.xml: No such file or directory

If i try other command (such as a find on the directory) I get this error:

find: `./Item from 23"2"60 with special chars.xml': Invalid argument

I'm hoping there's some way I can copy this file to somewhere writable (or mounted) and change the filename to remove/change the characters when copied.

--

I've tried a few other things I've found without success:

# pax -rw -s '/[?<>\\:*|\"]/_/gp' *chars.xml /mnt/writable/place/
pax: Unable to access Item from 23"2"60 with special chars.xml: Invalid argument
pax: WARNING! These file names were not selected:
Item from 23"2"60 with special chars.xml

Using single quotes:

# cp 'Item from 23"2"60 with special chars.xml' /mnt/writable/place/
cp: cannot stat `Item from 23"2"60 with special chars.xml': No such file or directory

Notes: Parent directory file permissions are all (and I am logged in as root):

drwxrwxrwx. 2 root root       2048 Jun 23  2014

Sample File listing (showing other files that are fine):

-rwxrwxrwx. 1 root root       10031 Jun 24  2014 Sports Preview 12-3-60.xml
-rwxrwxrwx. 1 root root  4539874077 Jun 24  2014 Sports preview 14-4-60.mov
-rwxrwxrwx. 1 root root  9367284750 Jun 24  2014 Sports preview 3-3-60 Boat Race.mov
-rwxrwxrwx. 1 root root 12825530544 Jun 24  2014 S.Preview 24-3-60.mov
??????????? ? ?    ?              ?            ? S.Preview 24""3"60.xml
-rwxrwxrwx. 1 root root       15449 Jun 24  2014 S.Preview 3-3-60 Boat rACE.xml
-rwxrwxrwx. 1 root root       12682 Jun 24  2014 S. Preview Junior Rugby.xml
-rwxrwxrwx. 1 root root 15348985946 Jun 24  2014 S.Preview March.mov

Let me know if you have any questions or suggestions you want me to try.

9
  • I don't think the name is the problem. I was able to create a file with the same name by wrapping it in single quotes. But all those question marks suggest there's a problem with the directory. Can you umount it and run fsck on it? Apr 16, 2019 at 13:50
  • Have you tried just single quotes? cp 'Item from 23"2"60 with special chars.xml' /tmp/x.xml Apr 16, 2019 at 13:53
  • Single quotes don't seem to work - see edited extra info
    – Smock
    Apr 16, 2019 at 14:04
  • As it's a filesystem that exists on a qstar tape system, I don't think I can fsck it. I can 'umountiv' and 'mountiv' but don't think I can do much else with it (or lack the expertise to do it confidently without destroying stuff). So you think the files might be corrupt or something?
    – Smock
    Apr 16, 2019 at 14:06
  • From man 2 stat: "execute (search) permission is required on all of the directories in pathname that lead to the file." I've never worked with tape. Can you mount it readable and run chmod +x on each directory? Or is there a special mount option for tapes? Apr 16, 2019 at 14:18

0

You must log in to answer this question.

Browse other questions tagged .