2

I'm trying to partition a usb stick to NTFS.

Before, I've wrongly flashed a windows iso using dd

dd if=./AME_2004_\(2020-09-16\).iso of=/dev/sdc status=progress

and since then I've been having problems formatting the drive.

Kde Partition Manager, cfdisk and fdisk all yield the same result when trying to partition the drive to NTFS

/dev/sdc read only file system

There isn't any physical switch on the usb, and the error doesn't seem to be caused by permissions issues. I've even tried to modify its permissions by using

sudo chown root:root -R /dev/sdc
sudo chmod 666 /dev/sdc

but the problem still persists. Other usbs work fine. I've tried flashing a (smaller) working usb onto the non-working one

sudo dd if=/dev/sdd of=/dev/sdc status=progress

now the problem persists and I can't even use every GB of the non-working usb

sdc      8:32   1   7.5G  0 disk
└─sdc1   8:33   1   3.7G  0 part

I objectively have no idea of what I'm doing and what to do, so if you know anything just please say it right away.

2 Answers 2

2

Looks like your system is automatically mounting any disk it sees. Check if your sdc is mounted somewhere: grep 'sdc' /proc/mounts. If that is the case, then umount -f /dev/sdc a few times, until it's nowhere to be seen in /proc/mounts. When that's done, zero out the disk with dd if=/dev/zero of=/dev/sdc. After that, tell the kernel to reread the disk's info: blockdev --rereadpt /dev/sdc. Now fdisk should have no complaints about that disk, unless of course there's something physically wrong with that disk as a coincidence.

3
  • yo, thanks for the response! Unfortunately dd is not able to entirely write the disk with zeros :( ~ ❯❯❯ sudo dd if=/dev/zero of=/dev/sdc status=progress 3874742272 bytes (3.9 GB, 3.6 GiB) copied, 13.0001 s, 298 MB/s Furthermore, this is the output of blockdev: ~ ❯❯❯ blockdev --rereadpt /dev/sdc blockdev: ioctl error on BLKRRPART: Inappropriate ioctl for device Commented Nov 3, 2020 at 11:37
  • 1
    Well, things die. Commented Nov 3, 2020 at 13:50
  • 1
    lol, still thanks a lot. You made me learn a lot of stuff. Commented Nov 4, 2020 at 10:22
2

Turns out, the kde auto-mounting system, udisks2 can cause quite a bit of trouble. Especially when trying to modify and update disk partitions.

Temporarily disabling udisk2 using sudo systemctl stop udisks2.service did it for me.

Refer to this thread for more

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.