39

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?

Braiam
  • 35,380
  • 25
  • 108
  • 167
user
  • 2,227
  • 6
  • 20
  • 25

2 Answers2

70
  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
    
Stephen Kitt
  • 411,918
  • 54
  • 1,065
  • 1,164
Ijaz Ahmad
  • 7,146
  • 5
  • 32
  • 45
  • 2
    when your disk size larger than 2TB, should use gdisk instead of fdisk. commands are simliar – temple Nov 27 '17 at 00:52
  • 15
    If your are using a GPT partition table, use 11 ([Microsoft Basic Data](https://en.wikipedia.org/wiki/Microsoft_basic_data_partition)) for the type instead of 7 – seg Feb 23 '21 at 10:25
  • well explained, helped me with my 8GB usb pendrive – Marcin Jun 11 '21 at 09: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. – David Faure Sep 22 '21 at 19:46
  • @temple why gdisk instead of fdisk? – pmiguelpinto90 Mar 02 '22 at 15:21
  • The classical fdisk is only for MBR partition tables, not for GPT. The gdisk is the equivalent of it for GPT. It is also known (from the man page) as the GPT fdisk . – temple Mar 13 '22 at 07:17
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 ...

Joke Sr. OK
  • 903
  • 1
  • 8
  • 11