Forgot your password?
typodupeerror

Which Filesystem Do You Use On Portable Media For Linux Systems? 569

Posted by timothy
from the hell-is-other-people's-file-permissions dept.
An anonymous reader writes "Most people use MS filesystems on Disk-On-Keys, and portable hard drives, as these are readable from most machines. But this way you lose the files' permission information, which many times is very inconvenient (you must agree that having Ubuntu asking you whether to execute or display every text file or image you open from a DOK is annoying). Using 'regular' Linux filesystems like ext keeps the permissions, but may require using the superuser when switching machines (as the UIDs are different). So do any of you have a creative solution for this problem?"
This discussion has been archived. No new comments can be posted.

Which Filesystem Do You Use On Portable Media For Linux Systems?

Comments Filter:
  • ext3 (Score:4, Insightful)

    by Dice (109560) on Thursday September 10, 2009 @04:51PM (#29383403)

    I don't use OSes other than Linux, so the choice is simple. If I did have to interact with Windows or OS X I'd probably use FAT32.

    • Re: (Score:2, Interesting)

      by timeOday (582209)
      How do you handle the uid issue raised in the summary? I'm thinking a different passwd file for each system might work. You'd probably need an /etc/shadow for each, at least.
      • Re: (Score:3, Informative)

        by Rick17JJ (744063)
        When installing Linux on more than one computer at home, I always make sure that I have the same UID number, on each computer. That way I avoid having permission problems, when accessing my files from an EXT3 formatted external hard drive, using one of my other Linux computers.

        On all three of my computers, my user name is Rick and my UID number is 1000. With most recent versions of Debian or Ubuntu, the first user created is assigned the UID number of 1000. So in most cases, I would get the same user ID
    • Re: (Score:3, Informative)

      by PopeRatzo (965947) *

      Which Filesystem Do You Use On Portable Media For Linux Systems?

      The best answer is: "It doesn't matter."

      I use whatever file-system happens to be on the portable media I happen to be using. I move data from Windows to Macs to Linux machines all day long and I never, ever have to think about which filesystem is on the portable media.

      This is a good thing.

    • Re: (Score:3, Informative)

      by H3g3m0n (642800)
      One worrying thing is the new exFat filesystem in use in newer version of Windows. You can be sure after the patent lawsuites suit's on normal Fat that there is patented stuff in exFat. Unfortunately a a new FS is going to be required soon as flash drives start to hit the larger sizes. With every desktop running Windows and most of the population not even knowing what a filesystem is, everyone will end up using it. It's also the standard for SDXC.

      This will of course leave Linux users screwed and every on
  • Well, now ... (Score:4, Insightful)

    by ScrewMaster (602015) * on Thursday September 10, 2009 @04:51PM (#29383407)

    So do any of you have a creative solution for this problem?

    Isn't the whole point of this "problem" that there shouldn't be a solution to the problem?

    • It's like the OP asks for a solution to a problem when using Linux, and then there's a grand cacophony of people denying that there is a problem! (when there is, why else was it presented?)

      There are two solutions that I use:

      1) Use tar to zip up the files with attributes, Then copy the .tar or .tgz file to the USB drive. Both Winzip and Archiver read tar files, so they can still be read on Win/Mac. Disadvantage? You can't easily save changes...

      2) create a loopback file on the USB drive, format Ext3, then mou

  • Poratibility (Score:5, Interesting)

    by IANAAC (692242) on Thursday September 10, 2009 @04:52PM (#29383421)
    Since we're talking about portable media, I want it portable and use fat32. That way I know I'll be able to use it pretty much everywhere.

    All my systems at home are Linux-based, ext3. NONE of my neighbors, family, or work associates have that, so it's a no-brainer.

    • Re: (Score:3, Interesting)

      by Petrushka (815171)

      Since we're talking about portable media, I want it portable and use fat32.

      I use FAT32 even on the HDD partition shared between Linux and Windows on my office machine. Other file systems have just caused me headaches with permissions in the past, though I suppose that's just because I wasn't managing them properly. I suppose I could change my ways, but it's easier just to use FAT. If that's ill-advised of me, maybe someone will tell me so :-)

      I'm not sure what I'm going to switch to when >4 GB files become more prevalent ...

      • Re:Poratibility (Score:4, Insightful)

        by eapache (1239018) on Thursday September 10, 2009 @05:17PM (#29383719) Homepage
        The Linux NTFS drivers are working well now. That's what I use on my shared partition.
        • Re: (Score:3, Informative)

          by Simetrical (1047518)

          The Linux NTFS drivers are working well now. That's what I use on my shared partition.

          Except if the portable drive is pulled out of the machine without being properly unmounted. Then the filesystem is unclean, and the Linux NTFS driver doesn't know how to replay the journal. So the thing becomes unusable until you stick it into a Windows machine and then remove it properly. Of course, you shouldn't be pulling it out without unmounting . . . that can cause serious data loss on some cheap USB drives, apparently, regardless of journaling.

      • by IANAAC (692242)

        I'm not sure what I'm going to switch to when >4 GB files become more prevalent ...

        There has only been one situation where I've had to move or copy a file over FAT32's filesize limit: Moving either a VMWare or VirtualBox image from one machine to another. It those cases, I upgraded disks and kept the same OS (some form of Linux), so it's not been a problem, since I had both the old and new disks connected to the same system. I would imagine it would be the same with any WinXP/Vista/7 box. You have

        • If you have needs for large files why wouldn't someone just stick it on a server, plug in the box to the server and download the file over a local network? Yeah, it might be slower but it sure would be cheaper (anything above 16 GB in a USB flash drive is -expensive- ) and would work on any OS.
      • by shimage (954282)
        As someone already mentioned NTFS is better. I'd feel naked using a non-journaling filesystem ... On the other hand, I've never had any permissions problems using ext under Windows, but I don't share this computer with anyone else.
    • by BlueBlade (123303)

      Of course, the problem with FAT32 is that it cannot accommodate file sizes larger than 4GB. In this day and age, carrying a few DVD ISOs around is quite common, so FAT32 doesn't quite cut it. What is needed is some kind of file system that doesn't use any permission, but is a bit more modern than FAT32.

  • I just use (Score:5, Insightful)

    by Darkness404 (1287218) on Thursday September 10, 2009 @04:53PM (#29383427)
    I just use FAT32 because the main point of my USB drive is to transfer data between computers and provide a backup of my most important documents. To be perfectly honest I don't know why anyone would need permissions on a USB drive. Most programs on Linux are easy enough that with your .whatever directory in your home folder simply just copy that to your drive and paste it on the new machine. With APT and such most software is easily accessible (making portable binaries like on Windows needless). So why would you even need it?
  • NTFS (Score:5, Funny)

    by mrcaseyj (902945) on Thursday September 10, 2009 @04:53PM (#29383431)

    Use NTFS?

  • HFS+ (Score:4, Informative)

    by binary paladin (684759) <binarypaladin@gm[ ].com ['ail' in gap]> on Thursday September 10, 2009 @04:54PM (#29383445)

    For the most part, I still use FAT32 since everything can read it. Simple as that.

    However, Linux has no issue reading HFS+ and my main machine is a Mac so it does the trick too.

  • I like to live dangerously.

  • uid issue (Score:4, Insightful)

    by james_shoemaker (12459) on Thursday September 10, 2009 @04:56PM (#29383469)

    Ever think of just making the uid's on your various machines match?

    James

    • Re: (Score:3, Insightful)

      by dbIII (701233)
      Permissions are irrelevant any when you can assume that whoever picks the thing up by accident or theft has root or Admin on their machine.
  • Mount noexec (Score:4, Informative)

    by MBCook (132727) <foobarsoft@foobarsoft.com> on Thursday September 10, 2009 @04:58PM (#29383477) Homepage

    If you don't want things to look executable, mount it with the noexec option (which you could put in fstab). That way nothing on the device, even with FAT, will appear executable.

    Since you are moving the files between computers, is the permissions loss really a problem? Aren't you just going to copy things off anyway?

    If you need to limit access to certain users, you could use encrypted loopback file systems. But really, why not just use separate USB keys for different sets of permissions.

    FAT is a lowest common denominator for a reason. If you want to interact with Windows, your only other real choice is NTFS, which isn't a bad option.

    Sure you could use Ext3, or Reiser, or BTFS, or something else, but then you can't use your flash drive on any machine, thus defeating it's purpose.

    • If you don't want things to look executable, mount it with the noexec option (which you could put in fstab). That way nothing on the device, even with FAT, will appear executable.

      An excellent solution, and probably not a bad idea anyways, for security reasons.

      And if you do want to preserve permissions, well, there's always tar or zip, both of which can make archives that preserve ownership and rights.

    • Re: (Score:3, Informative)

      by massysett (910130)

      If you don't want things to look executable, mount it with the noexec option (which you could put in fstab). That way nothing on the device, even with FAT, will appear executable.

      I just tested this out, and it does not work. mount(8) says that mounting something noexec means that execution of files on the filesystem is not allowed. However, that does not necessarily mean that the execute bit will be unset. Instead, on my system the execute permission bit is set, but attempting to execute something gives me "permission denied."

      I've had the problem the questioner asks about before; the cleanest solution is to use "fmask=133" in the mount options, as described in mount(8). (There are a

  • UID's (Score:4, Interesting)

    by aashenfe (558026) on Thursday September 10, 2009 @04:59PM (#29383487) Journal
    One of the annoying things about User ID's is that most Distros user utilities start at some number and count up. Then when you use nfs or removable media you find that the files are now owned by another user.

    It would be nice if the default was to pick a random arbitrary and large UID so the chance of UID clashes would be remote.
  • by C3ntaur (642283) <centaur.netmagic@net> on Thursday September 10, 2009 @04:59PM (#29383497) Journal
    Then, if I need to preserve Linux file settings I'll zip, tar, or cpio and store them on the stick that way.
    • by mrcaseyj (902945) on Thursday September 10, 2009 @05:13PM (#29383667)
      C3ntaur wrote:

      I invite anyone who claims CO2 is not a pollutant to sit in a room full of it for 10 minutes.

      I invite anyone who claims pure water is not a pollutant to sit in a room full of it for 10 minutes.

      • Re: (Score:3, Insightful)

        by _Sprocket_ (42527)

        I invite anyone who claims pudding is a pollutant to sit in $240 of it [youtube.com] for 10 minutes. Aaawww yeah.

    • by timeOday (582209)
      That doesn't help if you want to access the file on different systems with appropriate permissions though. One way or another, there has to be a mapping between different IDs on different systems.
  • DOK (Score:5, Insightful)

    by Anonymous Coward on Thursday September 10, 2009 @04:59PM (#29383503)

    What? Who on earth calls it a Disk on Key?

  • tarballs (Score:5, Interesting)

    by kwiqsilver (585008) on Thursday September 10, 2009 @05:02PM (#29383541)
    I use tarballs. I have Macs and Linux boxes, and I occasionally need to share with windows users, so I use Fat32 as my flash drive FS. But when switching files between two of my boxes, or another Unix-like box, I use tar jcvf foo.tbz <files>, then tar jxvf foo.tbz on the other side. It works great. I suppose now that I have a 32gb flash drive, I could drop the j and avoid the slight time delay of the compression, but it's an old habit.
  • FAT32 out the window (Score:4, Interesting)

    by jamyskis (958091) on Thursday September 10, 2009 @05:02PM (#29383543) Homepage

    Until very recently, I had a 32GB USB flash card formatted with FAT32. Not that I find FAT32 particularly nice, but it was practical, as it enabled me to easily swap my stuff between my home Windows game PC, my Linux PC, my work Linux laptop and my work Windows PC. The problem was never Linux - the problem was Windows and a lack of ext3 support (I develop under Linux and need the chmod permissions, which all turns to crap when I copy it over to FAT32, which doesn't retain them)

    Focus on the WAS. It WAS practical, until I was faced with the rather interesting prospect of copying an 7.5GB dual-layer DVD master image onto the stick. As we know, FAT32 has a file size limit of 6GB which causes all kinds of interesting problems.

    • by xaxa (988988)

      man split

      (I didn't find out about this one until a few months back, and I've been using *looks at RMS* GNU for years.)

    • Re: (Score:3, Informative)

      The file size limit in FAT32 volumes is 4GB (http://en.wikipedia.org/wiki/File_Allocation_Table#FAT32) and not 6GB.
  • by flyingfsck (986395) on Thursday September 10, 2009 @05:03PM (#29383553)
    NTFS with LUKS and FreeOTFE does the trick for me.
  • I use git or tortoisegit for my file transfer needs. There is also a samba share for my xbox to access movies and music. If that doesn't cover it, I have my flash drive somewhere with a portable copy of winscp.

    • Whoops, I guess I forgot to answer the actual question. I use ext3 with fat32 on that random flash drive :)

  • Really? FAT32. Because it works on everything.

    But it's possible to use ext2 and not lose cross-machine function ; there are filesystem drivers for Windows that are able to mount ext2. Of course, you have to pre-plan which machines you're going to use, and have administrator rights on them to install the driver, and it's not nearly as mature as the FAT32 driver is for both Linux and Windows.

    So, FAT32. Shame about the filesize limits, but there you go.

  • by Yaztromo (655250) <yaztromo@mac. c o m> on Thursday September 10, 2009 @05:08PM (#29383621) Homepage Journal

    This is hardly a problem unique to Linux, although as you point out Linux does have its own special requirements that may make using FAT32 a bit problematic.

    My home network is a combination of Mac OS X clients and Linux servers (Debian is so easily made so Mac friendly...). I have a USB key that I don't tend to use too often (online storage has removed much of that need), but I did decide at one point that easy interoperability between OS's was important, while at the same time needing OS-specific support from time-to-time, for specific applications and data.

    My solution? I formatted my key for FAT32, and then created some disk images on the key formatted them to whatever OS-specific format was suitable (HFS+, ext3, etc.). By leaving sufficient room on the main FAT32 volume, I can readily store platform-neutral data, and inside the images I can store whatever OS-specific data (such as applications) that don't need to be accessible on every system I encounter.

    This does require an extra mounting steps. In OS X, it entails plugging in the key, and then double-clicking on the DMG file to mount it. In Linux, I have to mount the ext3 image using the loop pseudo-device. Of course, this is only necessary if attempting to access data in one of the OS-specific formatted images: accessing shared data merely requires mounting the key itself (generally automatically handled by the OS).

    It's hardly perfect, but it does mean you can have one key that can have both shared and OS-specific data on it for as many OS's as you'd like to have at your disposal.

    Yaz.

  • Explore2fs (Score:4, Informative)

    by Pow.R Toc.H (12470) on Thursday September 10, 2009 @05:11PM (#29383643) Journal
    If you don't want much hassle, just use explore2fs (http://www.chrysocome.net/explore2fs [chrysocome.net]). It's an userland application which does not install any drivers or the like on Windows, and as such will execute as any user. However, you'll still need to transport it to the machines you'll want to use, and thus you'll need a tiny space of FAT32 for doing the trick.

    If you have rights to install drivers on the windows machines you use, you can try the EXT2 driver available on www.fs-driver.org [fs-driver.org]. It will mount your EXT2/EXT3 volume as a drive letter so you can transfer files between partitions.
  • fat32 works well enough for storing tarballs should I need to go Linux->Linux with permissions and all that. Most of the time though the UID/GID clashing isn't worth going so far as a tarball unless I need permissions preserved. I rarely transfer mixed permissions files, it's usually some form of document or media so again... fat32.

    I'd use a loopback ext3 if I really needed to not use tar for some weird reason.

  • native filesystem (Score:5, Interesting)

    by digitalhermit (113459) on Thursday September 10, 2009 @05:12PM (#29383663) Homepage

    I prefer to just dd my data to the raw device. If there's more than one file, I might pipe it through tar first. This process makes it much more portable and universal.

  • ext3 (Score:3, Interesting)

    by mukund (163654) on Thursday September 10, 2009 @05:27PM (#29383831) Homepage

    I have 3 Seagate FreeAgent 1 GB USB disks. They come with NTFS by default on them. Per disk:

    1. I make a LUKS dm_crypt volume on it (for which support is well integrated into GNOME and hal in Fedora and Ubuntu.. just plug in and it pops up a dialog asking for the password).

    2. I mkfs an ext3 filesystem on the encrypted volume.

    I use this encrypted setup out of experience, having dropped an older 750GB USB disk from a height. It works from time to time and I have to physically destroy it because contents on it are not encrypted and otherwise anyone who finds this disk in the trash can mount and browse it.

  • by strredwolf (532) on Thursday September 10, 2009 @05:35PM (#29383913) Homepage Journal

    First of all, FAT is patent encumbered and Microsoft's willing to go to court to protect it; so that's out. That includes the old UMSDOS file system Linux had at one time.

    Someone needs to make a good file system that matches FAT, but is more extensible. A good choice is ext2 now... if we dropped a few things that wouldn't work nicely. Like device nodes, pipes, and Unix sockets. Like ownership, since it's assumed that the person mounting the system would own the files on it, along with groups. Simply access restrictions; they wouldn't apply.

    This will simplify the structure a bit, which is a nice bonus and could let it be put on floppies. In other words, it's a light, anonymous, extended file system. LAEFS.

    I got an .h file. Anyone want to help develop it as a FUSE driver?

  • by Jahava (946858) on Thursday September 10, 2009 @05:58PM (#29384185)

    I had the exact same problem a while back. My solution was a little less straightforward than some, but is still simple enough. Basically, I leverage the freeware software Ext2 IFS [fs-driver.org], which installs software onto Windows that allows it to recognize the contents of Ext2/3 partitions.

    Basically, I have my disk formatted with two partitions:

    • A 1GB FAT32 Partition
    • The rest as an Ext3 Partition

    On the FAT32 partition, I place the latest version of Ext2 IFS. When I access the system on my main Linux box, I just mount / use the Ext3 partition.

    When I visit friends or family and I plug it into their Windows box for the first time, Windows recognizes the FAT32 partition, so I can install the Ext2 IFS software that I put onto that partition. From then on (and every subsequent access), Windows automatically mounts it!

    Windows doesn't reflect the Ext3 permissions, but if you have physical, portable access to an unencrypted hard drive, those mean nothing anyway. And, of course, make sure to ask friends and family before installing filesystem drivers :)

  • What about UDF? (Score:5, Insightful)

    by xororand (860319) on Thursday September 10, 2009 @06:07PM (#29384253)

    UDF doesn't have a 2 GB file size limit like FAT32 and seems to be well supported [wikipedia.org] by most operating systems. I don't really have any experience with it but I just formatted my USB stick with UDF just to see how it goes.
    mkudffs --media-type=hd --vid=MyDiskLabel /dev/disk/by-id/usb-LEXAR_JUMPDRIVE_ELITE
    It works fine in Linux.

  • by kabloom (755503) on Thursday September 10, 2009 @08:57PM (#29385287) Homepage

    At present you run into an issue where you could mount an ext2 or ext3 drive as a certain user, write files to it, and be unable to do anything with those files if you have a different UID on a different system.

    A kernel patch has been proposed to allow you to remap ext2/3 UIDs [lwn.net] when mounting a disk so that a standard UID can be mapped to whoever mounts the drive. This way, you'll be able to use ext2 or ext3 as your flash filesystem, preserve capitalization (another vfat weak point) and permissions (modulo the remapping) and still have decent interchange between different Linux boxes where you have different UIDs.

  • UFS/FFS (Score:3, Funny)

    by evilviper (135110) on Thursday September 10, 2009 @11:09PM (#29385983) Journal

    Far superior to FAT32 and Ext2 is the Unix File System (UFS). Unparalleled reliability, extended from the early days, and still going strong. Also known as the Berkley Fast Filesystem (FFS).

    Damn near everything supports it. Solaris/SunOS, HP-UX, Linux, BSD, MacOS, etc. And thanks to a couple of projects on SourceForge.net dedicated to writing UFS/FFS drivers for Windows, it's available there, too.

    Unfortunately, there are a lot of minor variations on the format... Differing types of disklabels (partition tables), big/little-endian byte-swapping, et al. I find sticking to BSD-created UFS/FFS file systems works best.

    Still, it's an incredibly solid filesystem, widely compatible, available, and just generally has everything you could want.

  • Use HFS+ (Score:3, Interesting)

    by williamyf (227051) on Friday September 11, 2009 @03:29AM (#29387049)

    HFS+ Can be read by both Linux and Mac. Preserves permisisons and such, and in SnowLeopard, Apple gently provided bootcamp drivers so that XP/Vista/7 can read HFS+ too. No hacks requiered, no big risk involved. There, solved that for ya!

"Never give in. Never give in. Never. Never. Never." -- Winston Churchill

Working...