LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 02-14-2013, 01:58 AM   #1
pandersson61
Member
 
Registered: Jan 2004
Distribution: Ubuntu 9.10, 10.04
Posts: 36

Rep: Reputation: 15
Multiple directories with exactly the same name in the same directory!


I'm trying to make mirror thumbnails of the files on mac to linux box. But sometimes i get two folders with the same name on my linux box.
To try to make this as easy to follow as possible i'll reproduce my steps below

1.) Rsync directories to mirror directory structure.
(sudo rsync -a --ignore-existing --include='*/' --exclude='*' /Volumes /var/www/img)
2.) Generate thumbnails with imagemagick
3.) Use gnus tar to compress the thumbs and directory structure
(tar -cf)
4.) Unpack the .tar on my linux box

I have tried fsck to merge the duplicate directories without result. At the moment i have no idea on how to proceed.
Does anyone have any idea?

Last edited by pandersson61; 02-14-2013 at 02:28 AM.
 
Old 02-14-2013, 07:08 PM   #2
sundialsvcs
Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,263

Rep: Reputation: 1085Reputation: 1085Reputation: 1085Reputation: 1085Reputation: 1085Reputation: 1085Reputation: 1085Reputation: 1085
Sounds to me like you're dealing with a case-sensitive vs. a case-insensitive file system. The default filesystem used by the Mac is case-insensitive, to match the original Macintosh conventions, although Macs (such as mine ...) do have a case-sensitive filesystem available. When setting up my MacBook, I reformatted the drives to use that ... tho' it might be a little too late to do the right thing now.
 
Old 05-15-2013, 08:40 AM   #3
pandersson61
Member
 
Registered: Jan 2004
Distribution: Ubuntu 9.10, 10.04
Posts: 36

Original Poster
Rep: Reputation: 15
Well the thing is that the mac filesystems are case-insensitive, but the mirrored file system is ext4. So it should not matter on the linux box.
I have attached a tar.gz that contains two directories with the same name. If you unpack it (under linux) you'll get two directories with exactly the same name. But under mac you'll get just one directory.
Strange stuff!
Does anyone have any idea?
Hopefully i will be able to solve this by merging the two directories together.

Checkout the file here, its just 14k.

Code:
http://speedy.sh/RYVqU/directories.tar.gz
 
Old 05-16-2013, 02:10 AM   #4
pandersson61
Member
 
Registered: Jan 2004
Distribution: Ubuntu 9.10, 10.04
Posts: 36

Original Poster
Rep: Reputation: 15
I found the issue, in case someone else encounters the problem ill explain it in short below.

It turns out that OS X uses "utf-8 nfd" and Linux uses "utf-8 nfc". So the character encoding is different (even though it doesn't show in linux).
So you have to convert the nfd filenames to nfc filenames. And you have to do that under Linux, Mac doesn't support using nfc.
There is a handy program to do that and its called "convmv". The command i used to convert all filenames in one folder is:

convmv -f utf8 -t utf8 --nfc --replace --nosmart --notest -r folder-name

Hope this helps someone...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple Folders to a Single Path yermandu Linux - Server 4 04-14-2010 04:18 PM
error with multiple shared folders snake_eyes Linux - Software 0 03-10-2009 04:30 PM
copying multiple files in multiple folders ?? stratotak Linux - Newbie 2 02-21-2009 09:41 AM
Rename multiple files in folders??? adds2one Linux - Software 19 10-05-2006 12:22 AM
Copying files from multiple folders into one aardwolf64 Linux - General 4 01-02-2006 11:53 PM


All times are GMT -5. The time now is 10:49 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration