Adding exFat Filesystem Support to Debian Squeeze and Ubuntu 10.04 or Newer
- May 12th, 2011
- Posted in CrunchBang Linux . Debian . Linux . NCLUG . Ubuntu, Kubuntu, Xubuntu, Fluxbuntu, Nubuntu, Geubuntu . Useful Software
- Write comment
If you’re like me, you store a lot of files that you use on a daily basis on a USB flash drive. I’ve been making due with a 16 GB flash drive for some time now, but even that seems to constantly be full. An opportunity came up a while back to purchase a 128 GB flash drive for really cheap, so I jumped on it. Although it worked fine at first on various Linux machines as well as on Windows7, something soon broke and the drive was no longer accessible (not visible at all) on any of my Linux machines. I was able to reformat the drive using the Windows7 Disk Management utility, but exFat was the only filesystem that it would allow me to choose when formatting the drive. Although I was not able to find any information on the subject at the time, now it seems that exFat functionality and support has become widely available to Linux users around the globe.
The method that I am about to describe is really not very difficult, but you should be aware that it does not allow you the plug-and-play convenience that you experience now with an average smaller flash drive (although it was not all that long ago when we had to mount flash drives manually anyway….). I had considered adding a reference in /etc/fstab that pointed to the drive, but if I were to already have another USB device plugged into the machine prior to attempting to auto mount the large flash drive, the /dev reference would likely have changed from what I would have listed it as in /etc/fstab. Instead, I use a simple Bash script to mount the device for me, and if it turns out that the /dev reference has changed, it’s easy to edit the file on the fly before executing it.
Instructions are listed below, and are also located in the script (which you can download from here). These instructions work for Debian Squeeze as well as for Ubuntu 10.04 or greater.
Instructions for enabling exFat support in Ubuntu 10.04 and newer and on Debian Squeeze: $ sudo add-apt-repository ppa:relan/exfat [FOR UBUNTU - DON'T DO THIS FOR DEBIAN SQUEEZE] $ sudo apt-get update $ sudo apt-get install subversion scons libfuse-dev gcc $ svn co http://exfat.googlecode.com/svn/trunk/ exfat-read-only $ cd exfat-read-only $ scons $ sudo scons install $ cd .. $ rm –rf exfat-read-only (OPTIONAL - ONLY IF YOU WANT TO REMOVE THIS DIRECTORY) $ sudo mkdir /media/whatever [creating mountpoint - example: sudo mkdir /media/exfat] $ sudo mount –t exfat-fuse [device_path] [mountpoint]
Sources/References:
- http://ubuntuforums.org/showthread.php?t=958476&page=3
- http://ubuntuforums.org/showpost.php?p=10484125&postcount=28
- https://launchpad.net/~relan/+archive/exfat
- http://winipulator.blogspot.com/2010/10/how-to-read-and-write-exfat-flash.html
- http://www.tannerjepsen.com/posts/exfat-fuse-module-for-ubuntu-with-readwrite-support
“..the /dev reference would likely have changed from what I would have listed it as in /etc/fstab.”
Actually, you could solve this by writing an Udev rule just for this device. You can match the rule on a number of characteristics, but usually idVendor and idProduct suffice to make an unique match (or at least a match for the device brand and type) on your system.
For example:
/etc/udev/rules.d/99-custom_rule:
SUBSYSTEM==”block”, ATTRS{idVendor}==”152d”, ATTRS{idProduct}==”2339″, NAME=”rugged%n”
This creates a /dev/rugged for each partition on a LaCie Rugged portable USB2.0 hard disk.
This looks like a sufficiently recent guide: https://wiki.archlinux.org/index.php/Udev
Would the mounted drive be writable or read only?
Thank you so much for your help! it worked great on my HP lap with Ubuntu 10.04.
@Karl
@Karl, the mounted drive would be read/write so you would be able to utilize it in whatever way you like.
How do I find the DEVICE PATH of the usb drive? I can see it using lsusb and I can cd to it, but I don’t know the device path to use the mount command.
@Goose,
Before inserting the USB device, I will make sure that I am familiar with what devices are currently mounted using:
$ sudo fdisk -l
This command will display a list of devices that are mounted as well as some information about the devices. You’ll also see the device path (ex: /dev/sda1).
Then I’ll usually copy the output of what’s in /dev to a text file:
$ ls /dev > devBefore.txt
Now plug your USB device in and run a similar command as before:
$ ls /dev > devAfter.txt
Now use a tool like meld or diff to see where the two files differ. Meld is a graphical tool and diff is a command line tool.
$ diff devBefore.txt devAfter.txt
You should see that there is now a new listing for the USB device in /dev. Perhaps it might be /dev/sdb or /dev/sdc or something like that.
Hope that helps.
2 thumbs up, that worked!
Also, this probably helps with the other issue of trying to connect my new tablet to ubuntu…
You rock! Thanks for the help.
-Goose
Thanks for the informative post regarding flash drive ex fat format that will work in both window OS and Linux (Ubuntu) OS. It is give freedom to transfer files OS independence.
The last part doesn’t work, it just shows me the usage help info of mount
I’m using Linux Mint Debian XFCE.
fdisk -l wasn’t listing the exFAT partition. I had to look for it on gparted.
Thank you so much for your contribution, This has worked perfectly in my Ubuntu 10.04 (I am a total beginner).
The only thing I could mention is that in the last step I could not copy, but write manually the command because of the – (short dash). Thanks again and all the best!! javi
I did this in Debain Squeeze KDE 4.5 and followed all the steps until this point:
“mount -t exfat-fuse [/devsdb1] [/media/usb0]FUSE exfat 0.9.7″
but I get this error:
ERROR: failed to open `[/devsdb1]‘ in read-write mode.
ERROR: failed to open `[/devsdb1]‘ in read-only mode.
Am I missing something?
How would I update my version of the install exFat Fuse support with subversion? It’s just a matter of re-downloading from the repository and re-installing?
@simpliztik23 in reading the error, it looks like you forgot to add a ‘/’ in between the “/dev” and the “sdb1″. Also, your mount point looks a bit off to me. Assuming that you are trying to mount to /media/usb0/FUSE, then try using this command:
sudo mount -t exfat-fuse /dev/sdb1 /media/usb0/FUSE/
@Phantasmagoria it depends on how your distro handles updates. Most distros allow you to update via a package manager, but you can only update to the latest version that has been packaged in the repositories that you are drawing from. If you need the very latest versions, you may need to compile from source:
Subversion: http://subversion.apache.org/source-code.html
exFat Fuse: http://code.google.com/p/exfat/
Thanks a lot, great hint.