# [SOLVED]File/dirname mess when copying files to ReiserFS LV

## tclover

I've just decided the other day to move away from TrueCrypt encrypted based FS, notably NTFS/exFAT, which I was keeping fore a while. So I decided to use ReiserFS and not Reiser4 to be safe... I don't use those drives unless I update the said backup. I'm not completly convinced about that FS choice but there're a fairly huge amount of small files and very big ones as well, so I guess the choice make sense (?).

Anyway, I'd like to move a few files from NTFS[-3g] to my newly ReiserFS based backup drives but... when copying files with Unicodes characters like "·", "ä", "ö" etc., every single characters is converted to "??" but it seems the "index" or rather tree still uses the right characters. 

I've got only an error when trying to list files/directories with something like `ls /path/to/dir/*(:t)' (in zsh) saying the files files/directories do not exist, well the good ones with the right filenames, even if the ones with the numerous "??" are still there. However using a plain `ls' works displaying the new file/dirname list with "??".

Somebody know something about this? 

I can safely copy files/directories to ext4 based FS, so I have no clue on this one despite googling.Last edited by tclover on Mon Oct 03, 2011 2:12 am; edited 1 time in total

----------

## tclover

Well then lets go to ext4 route... I'm gonnoa enable i_version (64-bit inode) and auto_da_alloc mount options and use mkfs.ext4 with these options `-O extend,flex_bg'. Somebody could help with a few ext4 options?

----------

## John R. Graham

Moved from Gentoo Chat to Kernel & Hardware. Support request so it fits better here.

- John

----------

## tclover

I've ran into a real weird issue... actually when trying to copy files/dirs to the ReiserFS LV, not only every unicode character is turned into "??" but the "source" LV is virtually turned into the same state as well. I said virtually because a umount/remount bring back the right file/dirname.

I've just noticed it when trying to convert UTF-8 file/dirname to UTF-8 (because the NFTS is mounted with nls=utf8). Why i'm doing this? just trying to figure out a way to copy files/dirs to ReiserFS LV... This is a lost game already.

Here is a little zsh script that could be handy for other stuff... one could easily modify it to `mv' instead of `cp'and add n-th sub-folders or convert other character set. I won't finish it because it's no use for me...

 *uzcp wrote:*   

> #!/bin/zsh
> 
> for (( arg=1; arg<$#; arg++ )) {
> 
> 	[[ -d "${(P)arg}" ]] && { mkdir "$(echo "${(P)#}"/${(P)arg(:t)}|iconv -f UTF-8 -t UTF-8)"
> ...

 

----------

## tclover

I've just re-fomated the LVs to ext4 FS the other day and was ready to back up my whole stuff and noticed that I could copy unicode file/dirname to another ReiserFS LV (/var actually) and was stunned to see that. I was like WTF?! So it seems a no superuser can copy unicode file/dirnames to a ReiserFS LV... root can as well... but when trying to list a no superuser files/dirs being root end up having a real fine/dirname mess with "??" everywhere?! That doesn't make sense at all!

So I'm entrusting my back up to ReiserFS LVs. I'm not decided what I'm going to do with the primary LVs which I use everyday... because this weirdness does not make me want to entrust my data to ReiserFS... I have a few doubts on ext4 as well... And there's no way I'm going to R4 or XFS, lets forget about JFS. I don't want my data to be eaten after a hard reboot! 

I'm just gonna convert two big NTFS based drives to ... ReiserFS|ext4 or anything that i could entrust my data. I'm gonna have headaches later when I'd like to use a few files in M$ w7 but i don't care anyway, I'd copy files to a tmp NTFS[/TrueCrypt PV] when need be. And anyway, w7 just left me in the dust the other day because I was trying to hack dll(s) to change that awful blueish theme... I'm not gonna use it any time soon anyway.

----------

## s4e8

export LC_ALL=en_US.utf8

----------

## tclover

I'm avoiding that... I have this:

 *root wrote:*   

> # locale
> 
> LANG=
> 
> LC_CTYPE="POSIX"
> ...

 

 *$USER wrote:*   

> % locale
> 
> LANG=en_US.UTF-8
> 
> LC_CTYPE="en_US.UTF-8"
> ...

 

and finally

 *Quote:*   

> % cat /etc/env.d/02locale
> 
> LC_TYPE="fr_FR@euro.UTF-8"

 

I had previously set `LANG="en_US.UTF-8"' globally in `/etc/env.d/02locale' but I removed a while ago for other trouble which I do not remember, well I could set it LNAG gloablly again to see if solves the issue. Although I'm not sure if it's the source of the trouble.

EDIT: Anyway, as I was saying previously it seems superuser can now copy safely unicode file/dirname. And the first attempt to copy various folders/files was done by $USER and not superuser and that I do not understand the least.

----------

## tclover

Issue soled with exporting LANG to a UTF-8 locale... the same could be done with LC_ALL with what it implies. So the previous copy which I did wasn't messed as I assumed. It was just listing them being root which explain I was seeing the same mess in source directories. Oh well, lets move a few files then.

----------

