54

How can I format a USB disk as ext3 using OS X Yosemite?

I want to use it on another system that is linux based but I wish to format it first before connecting to the linux system.

5 Answers 5

89

I needed to format a partition to ext3 on my USB flash drive. The drive was already formatted, and had 3 partitions, and I wanted to convert partition 1 from FAT32 to ext3.

  1. install brew, visit http://brew.sh/
  2. install e2fsprogs using brew install e2fsprogs
  3. figure out the name of your partition or drive using diskutil list -- in my case, my partition had was on disk2 and had the identifier of disk2s1
  4. If the drive is mounted, unmount it: diskutil unmountDisk disk2. Note that this is the drive in the listing above, not the partition.
  5. sudo $(brew --prefix e2fsprogs)/sbin/mkfs.ext3 /dev/disk2s1 but you may need to change the drive from disk2s1 to the partition or drive that you want to format. This command will ask you to verify the name of the partition, just to be sure :)

Note, if you're able to ssh/telnet into your router running dd-wrt or tomato, you can already directly run mkfs.ext3 directly in the router, and don't need to do anything on your mac at all

4
  • THANK YOU! This info was super useful, and I haven't seen it anywhere else in all my googling. BTW, my OpenWRT on WRT1900acs does not find e2fsprogs so I was struggling to get my USB formatted. May 28, 2016 at 0:56
  • 17
    I got stuck on this getting this error: '/dev/disk2: Resource busy while setting up superblock', until I tried 'diskutil unmountDisk disk2' then the following command worked 'sudo $(brew --prefix e2fsprogs)/sbin/mkfs.ext3 /dev/disk2'
    – jackkav
    Jun 1, 2016 at 14:25
  • Especially appreciated the DD-WRT note as it saved me the step of fetching the drive from the router to partition and format on my OpenWRT.
    – Crates
    May 9, 2017 at 3:29
  • The last line(about telnet into the router) actually can be more helpful if mentioned at beginning:)
    – Lei Zhang
    Mar 28, 2019 at 5:37
6

One totally free way of doing things would be to install VirtualBox and create a virtual machine which will run your favourite Linux distro. You should be able to do this with minimal impact on disk space.

I'd personally just use a common file format such as the universal FAT file system but obviously this isn't the answer you're looking for.

1
  • 8
    This falls short if you're trying to format an SD Card, as it runs on the PCI-E bus and can't be passed through to virtual machines. Jun 6, 2015 at 7:16
5

There is the commercial product Paragon ExtFS for Mac with which you can format even ext4 - I use it from time to time to access ext3 external hdd and it works quite well.

From their website:

Full read/write access to Ext2 / Ext3 / Ext4 partitions under Mac® OS X
Transfer rate is similar to the native Mac® OS Extended file system performance
Auto-mounting of Ext2 / Ext3 / Ext4 volumes
Full support of OS X 10.10 Yosemite!

No affiliation or whatsoever.

There is also OSXFuse as described in this artticle, but I do not think you can format a hdd with it.

Otherwise I agree with ScunnerDarkly - install linux in a virtual machine - or run a live disk (e.g. ubuntu) in a Virtual Machine, which might be the easiest.

1

With VMWare Fusion 11.1.1 and Ubuntu 18.04 LTS I was able to successfully format a Seagate 4TB Disk connected via USB 3.0 on my Mac OSX 10.13.6 Laptop using gparted to the ext3 fileformat which then later can be read using Fuse ext2 solutions.

It took some 3 hours for the procedure ... gparted shows a progress bar in the meantime: Progress bar for gparted

Today (2021-01-17) I repeated the procedure and it only took a few seconds on a 4 TB SSD disk

0

If you acquire Paragon ExtFS, you get a series of osxfuse file systems.

It will add the following filesystems to your system can be seen by Disk Utility to /System/Library/Filesystems:

UFSD_EXTFS                      Extended Filesystem 2
UFSD_EXTFS3                     Extended Filesystem 3
UFSD_EXTFS4                     Extended Filesystem 4

Run diskutil Listfilesystems to view all supported systems installed on your machine.

Find your drive device:

diskutil list

Assuming it is /dev/disk2 You can just type: diskutil eraseDisk for the expected input:

Usage:  diskutil eraseDisk format name [APM[Format]|MBR[Format]|GPT[Format]]
        MountPoint|DiskIdentifier|DeviceNode

I would run:

diskutil eraseDisk UFSD_EXTFS4 BananaPi /dev/disk2

When you are done you should see something like this diskutil list

/dev/disk2 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *4.0 GB     disk2
   1:                        EFI EFI                     209.7 MB   disk2s1
   2:           Linux Filesystem                         3.6 GB     disk2s2
   3:                 Apple_Boot Boot OS X               134.2 MB   disk2s3

You can then (supposedly--according to the Paragon manual) mount it (unfortunately only with paragon tools):

/usr/local/sbin/mount_ufsd_ExtFS /dev/disk2s2 /Volumes/mountPoint 

Addendum

Read-Only Solution

https://github.com/gerard/ext4fuse

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .