Answering your questions, one by one:
Why don't you have to defrag a Linux system? Because it's using the ext2/ext3 file system or because it's Linux?
Because ext2/3/4 have a different approach about the files and folders, so they barely get fragmented. Others have already answered about it, and you can read more details here
That's relevant, because a have a double boot system (W7 / Ubuntu) and a common partition (NTFS) that can be accessed by both system. If I'm using this partition with Linux, will it get fragmented?
Yes, it can get fragmented. It's not a matter if Windows or Linux or anything else is accessing it, it's how each filesystem deals with file size, how it stores all those blocks, whether it leaves empty spaces between each file...
Another issue are the Truecrypt containers. I also access them with Linux and Windows, and they are FAT32. Do they get fragmented by Linux operating on them?
Truecrypt containers are a file, for all pratical matters. When you create a container using TrueCrypt, you're creating a file of the size that you choose. For your operating system, it's just like any other file. If you make copies of it, etc, perhaps the copies might end up being saved fragmented.
But, remember, it's never good to have multiple copies of the same container, it might help to reduce the security of it. Always make a new container.
When you save, delete, copy, move, etc, files inside the container, the operating systems doesn't know about it, it's same of opening, editing and saving any other file, without changing it's size.
And if you're worried about truecrypt security about fragmentation, do some research about using truecrypt with SSDs: since the SSD try to lever the wear of all memory inside it, you might have the same effect of copying the container around.
e4defrag -v .
in a directory tree, especially if it contains, say, files downloaded with a torrent client (though some do usefallocate
/posix_fallocate
).