Mac Fdisk For Os X



In the Disk Utility app on your Mac, select a volume in the sidebar, then click the Partition button. In the pie chart, select the partition you want to delete, then click the Delete button. The partition is removed, reformatted, and all free space is assigned to the previous partition. But as of Mac OS X 10.4.6, Terminal also lets you perform a feat that previously required add-on software. Using a hidden command, you can resize disk partitions on-the-fly, without losing data. The DOS fdisk program can be used to divide space on the disk into parti- tions and set one active. This fdisk program serves a similar purpose to the DOS program. When called with no special flags, it prints the MBR partition table of the specified device, i.e., # fdisk fd0 Disk: fd0 geometry: 80/2/18 2880 sectors Offset: 0 Signature: 0xAA55.

Disk Utility User Guide

Partitioning a disk divides it into individual sections, each of which acts as a separate volume.

However, with APFS, you shouldn’t partition your disk in most cases. Instead, create multiple APFS volumes within a single partition. With the flexible space management provided by APFS, you can even install another version of macOS on an APFS volume.

Important: If you’re partitioning your internal physical disk because you want to install Windows, use Boot Camp Assistant instead. Do not use Disk Utility to remove a partition that was created using Boot Camp Assistant. Instead, use Boot Camp Assistant to remove the partition from your Mac.

Add a partition

Important: As a precaution, it’s best to back up your data before creating new partitions on your device.

  1. In the Disk Utility app on your Mac, select a volume in the sidebar, click the Partition button , then click Partition.

    Internal storage devices appear below the Internal section in the sidebar. External devices appear below the External section in the sidebar.

    When you select a volume that already has data on it, the pie chart shows a shaded area representing the amount of data on the volume and an unshaded area representing the amount of free space available for another volume. Disk Utility also shows whether the volume can be removed or resized.

    Note: If you see a small volume with an asterisk, the partition is smaller than can be represented at the correct scale in the chart.

  2. Click the Add button .

  3. Type a name for the volume in the Name field.

    For MS-DOS (FAT) and ExFAT volumes, the maximum length for the volume name is 11 characters.

  4. Click the Format pop-up menu, then choose a file system format.

  5. Enter the size or drag the resize control to increase or decrease the size of the volume.

  6. Click Apply, click Partition, then click Continue.

    Click Show Details to view the step-by-step process of creating a new volume.

  7. After the volumes are created, click Done.

After you partition a storage device, an icon for each volume appears in both the Disk Utility sidebar and the Finder sidebar.

Delete a partition

WARNING: When you delete a volume or partition, all the data on it is erased. Be sure to back up your data before you begin.

  1. In the Disk Utility app on your Mac, select a volume in the sidebar, click the Partition button , then click Partition.

  2. In the pie chart, click the partition you want to delete, then click the Delete button .

    If the Delete button is dimmed, you can’t delete the selected partition.

  3. Click Apply, then click Partition.

  4. After the volume is deleted, click Done.

Erase a partition

  1. In the Disk Utility app on your Mac, select the volume you want to erase in the sidebar.

  2. Click the Erase button , then click Erase.

    If the Erase button is dimmed, you can’t erase the selected volume.

  3. After the volume is erased, click Done.

Enlarge a partition on a storage device

If you have multiple partitions on a device and one of them is running out of space, you may be able to enlarge it without losing any of the files on it.

To enlarge a volume, you must delete the volume that comes after it on the device, then move the end point of the volume you want to enlarge into the freed space. You can’t enlarge the last volume on a device.

WARNING: When you delete a volume or partition, all the data on it is erased. Be sure to back up your data before you begin.

  1. In the Disk Utility app on your Mac, select a volume in the sidebar, then click the Partition button .

  2. In the pie chart, select the partition you want to delete, then click the Delete button .

  3. Click Apply.

    The partition is removed, reformatted, and all free space is assigned to the previous partition.

  4. Click Done.

See alsoFile system formats available in Disk Utility on MacAdd, delete, or erase APFS volumes in Disk Utility on MacAbout Disk Utility on Mac

I had a USB stick laying around and I had to put HFS+ on it to do some Mac OS X specific activities. Initially I had NTFS on it (just so I could use the usb stick across all OSes), and I wanted to format it back to NTFS using Mac OS X. As I was reading up on the process, I realized there are a couple of different ways to the approach.

Install ntfs-3g

I already had mac-ports setup on my mac (check out this post on the install process). After you have mac-ports installed, you can use the following to install ntfs-3g :

That will come with all the necessary tools to use NTFS (mount NTFS as read-write and to actually format partitions as NTFS) on Mac OS X.

BTW I was on Mac OS X Mavericks:

NTFS with MBR Using fdisk

So plug in the drive and check out it’s partitions:

FDisk_partition_scheme is the MBR style scheme and it looks like it has a FAT filesystem on it. So let’s erase the disk partition information from the drive:

Now checking out the drive, I don’t have any partitions on it:

Now let’s initialize the MBR style partition scheme on the disk

Mac

The above will also create a FAT partition on the disk. So let’s change the partition type with fdisk to NTFS:

As a side note if you don’t initialize the MBR scheme and you use fdisk it will ask you to initialize the partition table:

But then you will have create the partition with fdisk manually and it will create a FAT partition, which we will have to change later to NTFS (so inititiazing with disk from the command is faster… I think).

At this point you should see the following on the usb drive:

Now we format our partition as NTFS:

Lastly we can mount the partition

Mac Fdisk For Os X64

It will be mounted as read-write too:

NTFS with MBR Using diskutil and fdisk

We can also use diskutil to create an MBR partition scheme with a FAT partition all one command. First make sure nothing in on the disk:

Then run the following to create the MBR Scheme and FAT 32 Partition

From here you can do the same thing, change the partition type with fdisk,and then use mkntfs (from the ntfs-3g package) to format it as NTFS. BTW for reference here is a list of supported file systems by diskutil:

NTFS with GPT Using gpt and gdisk

Now let’s create a GPT partition scheme and put NTFS on the first partition. Let’s clear out the partitions and make sure nothing is one them:

To put a GPT partition scheme, run the following:

You can also use gpt to confirm the GPT Partition scheme is on there:

Now let’s use gdisk to create a partition of type NTFS on it:

Same thing from here, we can format it with mkntfs and mount it with ntfs-3g.

Remove GPT Partition Scheme

To remove the GPT paritition scheme first unmount the drive and then use gdisk :

At this point the disk should be empty:

We can also use dd to zero out both locations (GPT is stored/resides in two locations: at the beginning and end of the disk). From the gpt show command we can see where the end is:

First let’s zero out the secondary (end of the disk) GPT table:

The seek value is basically the value of the end of the partition seen from the gpt show command.

Now let’s do the primary (begining of disk) GPT Table:

And now the GPT partition scheme should be gone:

if you want, you can zero out the disk completely with diskutil (this process will be longer and it depends on the size of your usb drive… mine takes 24 mins and it’s 8GB).

NTFS with GPT Using diskutil

diskutil can create a GPT Partition Scheme and an MSDOS partion all in one swoop, make sure no partitions exists:

Then run the following to partition the drive:

Then you can just umount the disk and reformat it with NTFS since it’s type is already 07:

Mac Fdisk For Os X

It’s actually strange cause regular fdisk shows it as FAT:

Here is the unmount:

And to format:

Just to be safe, I unplugged the usb drive and plugged it back in and Mavericks auto mounted the drive as NTFS.

Replace mount_ntfs with ntfs-3g

By default when Mac OS X sees an NTFS Filesystem it mounts it as read-only. If you feel adventurous, you can follows the instructions laid out here to replace the default Mac OS NTFS mount binary. Here is the process:

Step 1. Install the ntfs-3g port.

Step 2. Find out your userid and groupid.

User ID:

Group ID:

Step 3. Use a modified mount_ntfs executable and save the OS X original to /sbin/mount_ntfs.orig.

Then paste in the following code and save it by typing Control-X and pressing “Y”. NOTE:

  • You can optionally substitute in your User ID and Group ID (from Step 2 above) in place of 501 and 20 in lines 4 and 5 below.
  • This script also assumes the standard MacPorts install location of /opt/local/ so you will need to modify it if yours is different.

Mac Fdisk For Os X 10.10

With that in place, if you ever plugin a usb-drive with NTFS on it, it will auto mount it as read-write.

Strangely enough there is another utility called pdisk, which allows you to create APM (Apple Partition Map) partition schemes, but diskutil can do that as well.