From: Bob Eager on
On Mon, 07 Jun 2010 09:25:00 +0100, Mike Clarke wrote:

> Bob Eager wrote:
>
>> On Sun, 06 Jun 2010 20:39:10 -0400, MZ wrote:
>>
>>> Tim Daneliuk wrote:
>>>> On 6/6/2010 5:53 PM, MZ wrote:
>>>>> I'm trying to remove a directory, but some of the files remain and
>>>>> it gives me the error "illegal byte sequence". How do I get rid of
>>>>> these files?
>
> [snip]
>
>>> I don't know if it's worth mentioning, but this folder was the /usr
>>> directory copied onto FreeBSD 8 from a FreeBSD 7.2 install. The
>>> specific problem directory is usr/local/lib/gcc-4.3.4/ ...
>>
>> Get the inode number for the directory, and clri(8) it? Then fsck.
>>
>> Drastic, but worked for me...even back on v6.
>
> Having got the inode number this might work, but only for deleting a
> single file at a time ...
>
> find . -inum nnnn -delete
>
> or, more cautiously
>
> find . -inum nnnn -ok rm {} \;
>
> ... this approach has often got me out of a hole when dealing with
> "impossible" file names.

I was thinking of ls -id on the directory, then zap that.

--
Using UNIX since v6 (1976)...

Use the BIG mirror service in the UK:
http://www.mirrorservice.org
From: Harald Hanche-Olsen on
+ MZ <mark(a)nospam.void>:

> It's a zfs volume, so I dont think it can be fsck'd.

That is important information. You should have told us from the start!
Then you wouldn't have wasted so much of other people's time.

My two cents worth: Try booting the system into opensolaris and try
deleting the files from there. Or try poking around in the archives of
the freebsd-fs mailing list or ask on that list, or find some other zfs
related mailing list.

--
* Harald Hanche-Olsen <URL:http://www.math.ntnu.no/~hanche/>
- It is undesirable to believe a proposition
when there is no ground whatsoever for supposing it is true.
-- Bertrand Russell
From: MZ on
Harald Hanche-Olsen wrote:
> + MZ <mark(a)nospam.void>:
>
>> It's a zfs volume, so I dont think it can be fsck'd.
>
> That is important information. You should have told us from the start!
> Then you wouldn't have wasted so much of other people's time.
>
> My two cents worth: Try booting the system into opensolaris and try
> deleting the files from there. Or try poking around in the archives of
> the freebsd-fs mailing list or ask on that list, or find some other zfs
> related mailing list.

I haven't the foggiest idea about how to boot into opensolaris...
From: MZ on
Bob Eager wrote:
> On Mon, 07 Jun 2010 09:25:00 +0100, Mike Clarke wrote:
>
>> Bob Eager wrote:
>>
>>> On Sun, 06 Jun 2010 20:39:10 -0400, MZ wrote:
>>>
>>>> Tim Daneliuk wrote:
>>>>> On 6/6/2010 5:53 PM, MZ wrote:
>>>>>> I'm trying to remove a directory, but some of the files remain and
>>>>>> it gives me the error "illegal byte sequence". How do I get rid of
>>>>>> these files?
>> [snip]
>>
>>>> I don't know if it's worth mentioning, but this folder was the /usr
>>>> directory copied onto FreeBSD 8 from a FreeBSD 7.2 install. The
>>>> specific problem directory is usr/local/lib/gcc-4.3.4/ ...
>>> Get the inode number for the directory, and clri(8) it? Then fsck.
>>>
>>> Drastic, but worked for me...even back on v6.
>> Having got the inode number this might work, but only for deleting a
>> single file at a time ...
>>
>> find . -inum nnnn -delete
>>
>> or, more cautiously
>>
>> find . -inum nnnn -ok rm {} \;
>>
>> ... this approach has often got me out of a hole when dealing with
>> "impossible" file names.
>
> I was thinking of ls -id on the directory, then zap that.
>

Still returns illegal byte sequence.
From: MZ on
David Malone wrote:
> MZ <mark(a)nospam.void> writes:
>
>> I'm trying to remove a directory, but some of the files remain and it
>> gives me the error "illegal byte sequence". How do I get rid of these
>> files?
>
> "Illegal byte sequence" sounds like a locale related error. You could
> try clearing running rm with a clear environment:
>
> env - rm -fr -- directory
>
> David.

Still returns illegal byte sequence.

# env - rm -fr -- local
rm: local/lib/gcc-4.3.4/include/c++/gnu/javax/imageio: Illegal byte sequence
rm: local/lib/gcc-4.3.4/include/c++/gnu/javax/print/PrinterDialog.h:
Illegal byt
e sequence
rm:
local/lib/gcc-4.3.4/include/c++/gnu/javax/print/PrintFlavorException.h: Ille
gal byte sequence
rm:
local/lib/gcc-4.3.4/include/c++/gnu/javax/print/PrintAttributeException.h: I
llegal byte sequence
rm: local/lib/gcc-4.3.4/include/c++/gnu/javax/print/CupsIppOperation.h:
Illegal
byte sequence
rm:
local/lib/gcc-4.3.4/include/c++/gnu/javax/print/CupsPrintServiceLookup.h: Il
legal byte sequence
rm: local/lib/gcc-4.3.4/include/c++/gnu/javax/print/CupsPrintService.h:
Illegal
byte sequence
rm: local/lib/gcc-4.3.4/include/c++/gnu/javax/print/PrintUriException.h:
Illegal
byte sequence
rm: local/lib/gcc-4.3.4/include/c++/gnu/javax/print/CupsServer.h:
Illegal byte s
equence
rm: local/lib/gcc-4.3.4/include/c++/gnu/javax/print: Directory not empty
rm: local/lib/gcc-4.3.4/include/c++/gnu/javax: Directory not empty
rm: local/lib/gcc-4.3.4/include/c++/gnu: Directory not empty
rm: local/lib/gcc-4.3.4/include/c++: Directory not empty
rm: local/lib/gcc-4.3.4/include: Directory not empty
rm: local/lib/gcc-4.3.4: Directory not empty
rm: local/lib: Directory not empty
rm: local: Directory not empty