3

I am trying to completely erase and format all my drives except /dev/sda (my main SSD with Debian on it). I'm getting a few errors, and I'm not entirely sure I'm doing it correctly.

$ lsblk

sdb      8:16   0 931.5G  0 disk

So /dev/sdb is the drive I want fully formatted into NTFS and mounted. I do this to erase partitions, MBR, and so on:

$ dd if=/dev/zero of=/dev/sdb bs=512 count=1

Then I can do:

$ parted /dev/sdb mklabel gpt
$ parted /dev/sdb p

Model: ATA WDC WD10EARS-00Y (scsi)
Disk /dev/sdb: 1000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start  End  Size  File system  Name  Flags

So the drive now has a GPT partition table. Then I create the NTFS partition and print the details again:

$ parted /dev/sdb mkpart primary ntfs 0% 100%
$ parted /dev/sdb p

Model: ATA WDC WD10EARS-00Y (scsi)
Disk /dev/sdb: 1000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name     Flags
 1      1049kB  1000GB  1000GB               primary  msftdata

And you can see it has the full 1TB it's supposed to.

Now I should be able to either edit /etc/fstab or simply mount /dev/sdb /home/1TB/. I'll do the fstab:

$ blkid

/dev/sda1: UUID="3608e3af-e6b3-4d63-a234-6bd53813e983" TYPE="ext4" PARTUUID="118c8db8-01"
/dev/sda5: UUID="b2091441-279b-4013-b7b1-299de571280f" TYPE="swap" PARTUUID="118c8db8-05"
/dev/sdb1: PARTLABEL="primary" PARTUUID="12c3cc3a-ce49-437b-b4d9-81c75a8f5d51"

and edit /etc/fstab to include the PARTUUID:

PARTUUID=12c3cc3a-ce49-437b-b4d9-81c75a8f5d51 /home/1TB/ ntfs defaults

and finally I can mount it:

$ mount -a

But then I get an error:

mount: wrong fs type, bad option, bad superblock on /dev/sdb1 missing codepage or helper program, or other error

In some cases useful info is found in syslog - try dmesg | tail or so.

I've searched for solutions and why it might be wrong, but I simply can't figure out why it's not working. I do have nfs-common and cifs-utils installed. I just want to format my drive(s), make a single NTFS partition, and then mount them using fstab.

3
  • Have you tried using gparted to format? Jan 22, 2018 at 19:00
  • @MichaelCorleone Nope, what would the difference be between gparted and parted in terms of what I did and what you can? Jan 22, 2018 at 20:19
  • you must first format the partition and after you can be able to mount it. Jan 22, 2018 at 20:24

2 Answers 2

3

The error says that there is no filesystem.

So you must first format the partition and after you can be able to mount it.

Run this command:

mkfs.ntfs -f /dev/sdb1

The -f means fast format

I also advice you to check if the package ntfs-3g is present on your machine, if no install it and change the entries in your /etc/fstab from ntfs to ntfs-3g

The ntfs that you are using in the fstab has limited functionality

Quoting from gentoo wiki about ntfs

Be aware: as of November, 2017, the mainlined NTFS kernel driver has very limited functional support for NTFS. The kernel configuration information defines support as "partial, but safe". This driver can overwrite existing files but is not capable of file or directory creation, deletion, or renaming.1 Most NTFS users will want to to enable the FUSE powered version.

0
0

You can't mount a partition. You need to create a filesystem inside that partition first. Use mkntfs to do so. Then you can mount that filesystem.

5
  • What? How would I go on about that? Jan 22, 2018 at 19:00
  • there is a tool called mkntfs. Jan 22, 2018 at 19:03
  • If you're going to post an answer, please post an answer or tell me where I've failed. Jan 22, 2018 at 19:04
  • You forgot to create a filesystem on your partition. Clear enough? Jan 22, 2018 at 19:05
  • 3
    @GerardH.Pille Please try to explain your proposed solution expanding the answer and not in comments where possible. Better quality answers will get more upvotes too. Jan 22, 2018 at 19:16

You must log in to answer this question.

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