43

I would like to know how to create a ntfs partition on /dev/sdx. I could not figure out if I should use partition type 7 86 or 87.

What is the full list of commands to use?

3
  • 1
    With partition type 7 86 or 87 I assume you mean the fdisk shell partition types, of course. Commented Oct 6, 2017 at 21:02
  • 2
    This is no longer valid for GPT.... type 7 in GPT partitioning is for power pc
    – Raul Luna
    Commented Sep 21, 2020 at 15:14
  • Yes, it seems to not work in GPT; but what is OK for GPT? 11 (Microsoft basic data)? Or 17 (HP-UX). Or is it better to change partition table to DOS for that? Commented Feb 2, 2022 at 12:42

2 Answers 2

75
  1. create a partition using fdisk

    fdisk /dev/sdx
    

    Commands:

    • to create the partition: n, p, [enter], [enter]
    • to give a type to the partition: t, 7 (don't select 86 or 87, those are for volume sets)
    • if you want to make it bootable: a
    • to see the changes: p
    • to write the changes: w
  2. create a ntfs fileystem on /dev/sdx1:

    mkfs.ntfs -f /dev/sdx1
    

    (the -f argument makes the command run fast, skipping both the bad block check and the zeroing of the storage)

  3. mount it wherever you want

    mount /dev/sdx1 /mnt/myNtfsDevice
    
6
  • 2
    when your disk size larger than 2TB, should use gdisk instead of fdisk. commands are simliar
    – temple
    Commented Nov 27, 2017 at 0:52
  • 18
    If your are using a GPT partition table, use 11 (Microsoft Basic Data) for the type instead of 7
    – seg
    Commented Feb 23, 2021 at 10:25
  • well explained, helped me with my 8GB usb pendrive
    – Marcin
    Commented Jun 11, 2021 at 9:19
  • 1
    In gdisk 1.0.8 (at least) the type to use for Microsoft Basic Data is actually 700, as shown in the "L" output. Commented Sep 22, 2021 at 19:46
  • @temple why gdisk instead of fdisk? Commented Mar 2, 2022 at 15:21
3

You can use fdisk to create the partition "disk" division but for the partition's file system you can use the mkfs.ntfs to create the file system in the partition that will use ...

You must log in to answer this question.

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