Re: Odd FFS behavior

Previous thread: PacSec 2007 Agenda (Tokyo 11-29/30) by Dragos Ruiu on Sunday, October 21, 2007 - 9:43 pm. (1 message)

Next thread: About Xen: maybe a reiterative question but .. by carlopmart on Monday, October 22, 2007 - 1:05 am. (49 messages)
From: Edd Barrett
Date: Monday, October 22, 2007 - 12:45 am

Hi there,

I have an odd one for you here. Im trying to copy music from a hard
disk(FFS) mounted on /mnt/media. I can play the music with mplayer
just fine, but cp seems to refuse to believe that the files exist.

Whats going on?


---8<---
# fsck /mnt/media
** /dev/rwd1a (NO WRITE)
** Last Mounted on /mnt/media
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
50647 files, 14741198 used, 24829133 free (1229 frags, 3103488 blocks,
0.0% frag mentation)
# pwd
/mnt/media/OGG/devil_sold_his_soul
# find a_fragile_hope/
a_fragile_hope/
a_fragile_hope/at_the_end_of_the_tunnel.ogg
a_fragile_hope/as_the_storm_unfolds.ogg
a_fragile_hope/dawn_of_the_first_day.ogg
a_fragile_hope/awaiting_the_flood.ogg
a_fragile_hope/between_two_words.ogg
a_fragile_hope/sirens_chant.ogg
a_fragile_hope/hope.ogg
a_fragile_hope/in_the_absence_of_light.ogg
a_fragile_hope/in_absense_of_light.ogg
a_fragile_hope/the_starting.ogg
a_fragile_hope/the_coroner.ogg
# cp -r a_fragile_hope /mnt/usb
cp: /mnt/usb/a_fragile_hope/the_coroner.ogg: No such file or directory
cp: /mnt/usb/a_fragile_hope/as_the_storm_unfolds.ogg: No such file or directory
cp: /mnt/usb/a_fragile_hope/dawn_of_the_first_day.ogg: No such file or directory
cp: /mnt/usb/a_fragile_hope/awaiting_the_flood.ogg: No such file or directory
cp: /mnt/usb/a_fragile_hope/between_two_words.ogg: No such file or directory
cp: /mnt/usb/a_fragile_hope/sirens_chant.ogg: No such file or directory
cp: /mnt/usb/a_fragile_hope/hope.ogg: No such file or directory
cp: /mnt/usb/a_fragile_hope/in_the_absence_of_light.ogg: No such file
or directo ry
cp: /mnt/usb/a_fragile_hope/in_absense_of_light.ogg: No such file or directory
cp: /mnt/usb/a_fragile_hope/the_starting.ogg: No such file or directory
cp: /mnt/usb/a_fragile_hope/at_the_end_of_the_tunnel.ogg: No such file
or direct ory
-- 
Best ...
From: Otto Moerbeek
Date: Monday, October 22, 2007 - 1:14 am

Does your target dir /mnt/usb exist?


From: Edd Barrett
Date: Monday, October 22, 2007 - 2:14 am

It does. I copied another album onto an SD mounted there and listened
to it on the way to work today.

-- 
Best Regards

Edd

---------------------------------------------------
http://students.dec.bournemouth.ac.uk/ebarrett

From: Otto Moerbeek
Date: Monday, October 22, 2007 - 2:46 am

Show a ls -la of the source dir and a stat(1) of the dir and at least
one of the problem files. 

	-Otto

From: David Vasek
Date: Monday, October 22, 2007 - 3:26 am

Hello,
perhaps output of the following will be more useful:
mount |grep /mnt/usb
df /mnt/usb
df -i /mnt/usb
ls -la /mnt/usb
fsck /mnt/usb

The cp program complains about the target files, not the source.

Regards,
David

From: Denise H. G.
Date: Monday, October 22, 2007 - 3:47 am

-- 
And God spake unto Moses, and said unto him, I am the LORD:
		-- Exodus 6:2

From: Aaron W. Hsu
Date: Monday, October 22, 2007 - 9:49 am

I have experienced similar behaviour, except that, with me, after I do an 
archive extraction, or a file concatenation of many files, while the file 
system only shows one set of files, additional files which were deleted after 
the extraction, continue to be listed as existing when I try to do operations 
on the directory as a whole.

  $ cp -R dir new/
  Failure! Cannot copy some non-existent file.

  $ cp -R dir/*.x new/
  Works.

It is very strange.

-- 
((name "Aaron Hsu")
 (email/xmpp "arcfide@sacrificumdeo.net")
 (phone "703-597-7656")
 (site "http://www.aaronhsu.com"))

[demime 1.01d removed an attachment of type application/pgp-signature]

From: Edd Barrett
Date: Thursday, October 25, 2007 - 12:52 am

Hi,


I know what has happened?

---8<---
# ls
a_fragile_hope      darkness_prevails
# ls /mnt/usb
palm       volume.nam
# cp -R a_fragile_hope /mnt/usb
cp: /mnt/usb/a_fragile_hope/the_coroner.ogg: No such file or directory
cp: /mnt/usb/a_fragile_hope/as_the_storm_unfolds.ogg: No such file or directory
cp: /mnt/usb/a_fragile_hope/dawn_of_the_first_day.ogg: No such file or directory
cp: /mnt/usb/a_fragile_hope/awaiting_the_flood.ogg: No such file or directory
cp: /mnt/usb/a_fragile_hope/between_two_words.ogg: No such file or directory
cp: /mnt/usb/a_fragile_hope/sirens_chant.ogg: No such file or directory
cp: /mnt/usb/a_fragile_hope/hope.ogg: No such file or directory
cp: /mnt/usb/a_fragile_hope/in_the_absence_of_light.ogg: No such file
or directo
 ry
cp: /mnt/usb/a_fragile_hope/in_absense_of_light.ogg: No such file or directory
cp: /mnt/usb/a_fragile_hope/the_starting.ogg: No such file or directory
cp: /mnt/usb/a_fragile_hope/at_the_end_of_the_tunnel.ogg: No such file
or direct
ory
# ls /mnt/usb
a_frag~1   palm       volume.nam
---8<---

The directory made has been truncated msdos style. "a_frag~1".
Therefore when cp tries to copy files into the new directory, it can't
find the new filename.

The workaround is to do something like this, with a shorter filename
---8<---
# cp -R a_fragile_hope /mnt/usb/a
---8<---



-- 
Best Regards

Edd

---------------------------------------------------
http://students.dec.bournemouth.ac.uk/ebarrett

From: David Vasek
Date: Thursday, October 25, 2007 - 1:57 am

While this is a workaround, mounting it with "-l" parameter (mount_msdos 
-l) should be the proper solution. Of course, unless you need to keep the 
filenames short.

On the other hand, one would expect the filesystem code to truncate the 
filename before actually trying to open a file on such a filesystem. I 
think that Msoft designed it that way. Currently, you create a file and 
cannot stat it immediately afterwards. Oh, and a different new file has 
appeared there in the meantime! I think it shouldn't work this way. Is it 
a valid assumption?

Regards,
David

From: ropers
Date: Tuesday, October 30, 2007 - 12:24 pm

Be VERY careful with LFN support and 8.3 filenames. MS' implementation
of LFN support is broken by design, because the short filenames are
not saved along with the long ones and instead are autogenerated from
the long ones -- which, if you have a set of similarly named files
with long filenames can easily result in a 8.3 filename referring to a
different file after you delete and copy.

See the section "Ambiguous LFNs" here:
http://users.iafrica.com/c/cq/cquirke/lfns.htm

The upshot is, you're best off avoiding these older 8.3 FAT file
systems altogether.

From: Lars Hansson
Date: Thursday, October 25, 2007 - 3:30 am

or make sure you have a long filename in the root directory of the
partition or mount with -l.

---
Lars Hansson

From: Edd Barrett
Date: Thursday, October 25, 2007 - 5:06 am

Aha! great.



-- 
Best Regards

Edd

---------------------------------------------------
http://students.dec.bournemouth.ac.uk/ebarrett

Previous thread: PacSec 2007 Agenda (Tokyo 11-29/30) by Dragos Ruiu on Sunday, October 21, 2007 - 9:43 pm. (1 message)

Next thread: About Xen: maybe a reiterative question but .. by carlopmart on Monday, October 22, 2007 - 1:05 am. (49 messages)