eCryptfs file name maximum length is shorter than in ext3

Bug #359531 reported by bughunter
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
ecryptfs-utils (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

The situation is easy: I decided to encrypt my new hdd. I downloaded Ubuntu 9.04 alternate install CD and chosed encrypted LVM at partitioning. (I did not have the option to use a key file, I had to enter a passpharse which can be another bug.)

After all I started to copy data from my old ext3 file system to the new LVM. (Digression. Copying Linux files are not easy because of the permissions. If I copy them with root user all destination files will be root. If I set the option to preserwe owner, the owner will be the old user. But I started to use a new user name! So the only way to copy is to mount the old volume with the new user, and if there are files with root owner, then do something. I'm not on this point yet. Because... read the next paragraph! At least there are the command 'dd' but this is the only thing which makes copying volumes better in Linux than Windows.)

But! Some files couldn't be copied. I have got the error: File name too long (36). I was wondering, I was using a newer file system, LVM. Then I started to look after it and I was shocked: the maximum file name size in Linux is 256 charachters. (And only in ext3, in LVM it seems to be shorter.) At least it is 1 more longer than in Windows: http://www.ntfs.com/ntfs_vs_fat.htm , but I have found some bug reports on the internet, when someone tryed to copy UTF-16 named files. This is their problem, I only hope, I did not lose files when I changed from Windows to Linux.

So I made some experiements, here the results. Enjoy!

LVM:

$ touch 1___________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________256
touch: cannot touch `1___________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________256': File name too long

ext3:

$ touch 1___________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________256

$ ls 1*
1___________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________256

~$ touch "This is a very long file name. Linux can not handle it, which reminds me the old DOS operating system with file name size 8 characters and 3 characters exestion. Or it reminds me the wonderful Turbo Pascal 6.0 with maximum string size 255. But sometimes we have file names more than 256 characters."
touch: "This is a very long file name. Linux can not handle it, which reminds me the old DOS operating system with file name size 8 characters and 3 characters exestion. Or it reminds me the wonderful Turbo Pascal 6.0 with maximum string size 255. But sometimes we have file names more than 256 characters." elérése sikertelen: A fájlnév túl hosszú

(The meaning of the last words: acces unsuccesful: The file name is too long. Sorry, I couldn't made Linux to speak English, there is a prefix for it. Does somebody know it?)

Revision history for this message
Yung-Chin Oei (yungchin) wrote :

Hi, you're right that ext3 has a limited filename size at 255 bytes - it depends on what character encoding you use how many characters that implies, but at most 255. In your example with only underscores and numbers I think you should be able to fit 255. It works for me.

LVM is not a file system, but rather a modern partitioning model. Inside a logical volume, you would still set up a file system, like ext3. So... my first guess is that perhaps the installer selected something other than ext3 for the file system in your LVM test.

Could you check what file system is in use? One quick way to do this is to look at the output of "df -T" (see the man page for details).

Revision history for this message
bughunter (ha030-deactivatedaccount) wrote :

I was studying how LVM works and by now I know this is only a logical system. Upon it the alternate install process made me a fine ext3. The beginning of "dr -T" is:

Filesystem Type 1K-blocks Used Available Use% Mounted on
/dev/mapper/noname-root
              ext3

I measured: file name size 144 char was accepted, 145 was too long:

noname@noname:~$ touch 1___________________________________________________________________________________________________________________________________________144
noname@noname:~$ touch 1____________________________________________________________________________________________________________________________________________145
touch: cannot touch `1____________________________________________________________________________________________________________________________________________145': File name too long

Then I installed 8.10 and the system works fine. Both of them were encrypted LVM.

Revision history for this message
bughunter (ha030-deactivatedaccount) wrote :

I made a brother bug of this: https://bugs.launchpad.net/ubuntu/+bug/360219

Revision history for this message
Yung-Chin Oei (yungchin) wrote :

Hi, thanks for the follow-up. So your tests suggest that ext3 long-filename support is broken in Ubuntu 9.04, while the use of encrypted LVM may or may not be influencing the problem.

As 9.04 is still under development, can you add what date your install disc was from, and whether you tried to update the system to the latest state?

I'll have to test this on an install of my own to be able to mark it confirmed, but am a bit pressed for time right now - hopefully someone else can pick up on this before I get to it, because this could turn out nasty as a dist-upgrade bug.

Revision history for this message
bughunter (ha030-deactivatedaccount) wrote :

Hi, I was using this link: http://ftp.freepark.org/pub/CDROM-Images/ubuntu/jaunty/ubuntu-9.04-beta-alternate-i386.iso

And the exact time of the downloaded file were: 2009-03-24 07:57. (This is not the time, when I downloaded it, it happened last week.)

Revision history for this message
Gabe Gorelick (gabegorelick) wrote :

Is this still an issue on Karmic or Lucid Beta?

Changed in ubuntu:
status: New → Incomplete
Revision history for this message
Paddy Launch (paddylaunch-deactivatedaccount) wrote : Re: [Bug 359531] Re: LVM file name maximum length is shorter than in ext3

Yes, I had two filenames rejected for length when i copied across data
from my old hdd. However, I thought two was pretty acceptable, so I
just renamed them.

On Wed, Mar 31, 2010 at 10:02:08PM -0000, Gabe Gorelick wrote:
> Is this still an issue on Karmic or Lucid Beta?
>

Revision history for this message
Paddy Launch (paddylaunch-deactivatedaccount) wrote : Re: LVM file name maximum length is shorter than in ext3

Sorry, I was mistaken, I'm not using LVM, I'm using the encrypted home directory (ecryptfs). Is it the same issue?

affects: ubuntu → ecryptfs-utils (Ubuntu)
Changed in ecryptfs-utils (Ubuntu):
status: Incomplete → New
Revision history for this message
bitinerant (bitinerant) wrote :

Could someone change the title of this report to mention eCryptfs rather than LVM?

Revision history for this message
Gabe Gorelick (gabegorelick) wrote :

@bitinerant
This bug is a duplicate so the name really doesn't matter, but just so you know you can change the title of the bug yourself by clicking the yellow button next to the title.

psylem (subnetjet)
summary: - LVM file name maximum length is shorter than in ext3
+ eCryptfs file name maximum length is shorter than in ext3
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ecryptfs-utils (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.