impossible to format an internal disk

I can't format a bunch of internal disks that I have bought in second hand from a datacenter. The disks were formatted in NTFS, this is 3 2TB seagate constellation ES +2 1TB seagate constellation ES + 1 WDC RE3 1TB. I have done a new partition table (try with gpt and dos) for each of them with fdisk and create a new partition. But each time I try to format to ext4 for example it gives me an error like :

/dev/sdg1 is apparently in use by the system; will not make a filesystem here!

or an unknown error with gparted but if I format in ntfs it's okay. can't be normal right? What should I do? I'm a bit without a clue here. Configuration: ubuntu:16.04.1

Edit: To show you the whole process:

@docker:~$ sudo sfdisk -l /dev/sdh
Disque /dev/sdh : 1,8 TiB, 2000398934016 octets, 3907029168 secteurs
Unités : sectors of 1 * 512 = 512 octets
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0abdc00e
@docker:~$ sudo fdisk /dev/sdh

Welcome to fdisk (util-linux 2.27.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Commande (m pour l'aide) : o
Created a new DOS disklabel with disk identifier 0x18c440ee.

Commande (m pour l'aide) : n
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): p
Numéro de partition (1-4, 1 par défaut) : 
Premier secteur (2048-3907029167, 2048 par défaut) : 
Last sector, +sectors or +size{K,M,G,T,P} (2048-3907029167, 3907029167 par défaut) : 

Created a new partition 1 of type 'Linux' and of size 1,8 TiB.

Commande (m pour l'aide) : w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

@docker:~$ sudo mkfs.ext4 /dev/sdh1
mke2fs 1.42.13 (17-May-2015)
/dev/sdh1 est apparemment utilisé par le système ; ne fera pas un système de fichiers ici !
@docker:~$ sudo umount /dev/sdh1
umount: /dev/sdh1: not mounted
vigilian@docker:~$ sudo sfdisk §l /dev/sdh
sfdisk: failed to parse partition number: '/dev/sdh'
vigilian@docker:~$ sudo sfdisk -l /dev/sdh                                                         
Disque /dev/sdh : 1,8 TiB, 2000398934016 octets, 3907029168 secteurs
Unités : sectors of 1 * 512 = 512 octets
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x18c440ee

Périphérique Amorçage Start        Fin   Secteurs  Size Id Type
/dev/sdh1              2048 3907029167 3907027120  1,8T 83 Linux
0
задан 13 September 2016 в 14:22
2 ответа

Итак, благодаря @MikhailKhirgiy кажется, что ни один из инструментов gparted или fdisk на самом деле не стирает старую таблицу разделов центра обработки данных. Причина неясна, но решение состоит в том, чтобы стереть первые строки байтов диска с помощью: sudo dd if = / dev / zero of = / dev / sdh bs = 8M count = 8

благодаря ему.

0
ответ дан 5 December 2019 в 09:33

Перед тем, как изменить раздел или что-то еще, вы должны размонтировать диск

Эта команда должна работать для вас: umount / dev / sdg *

После этого попробуйте еще раз создать раздел

Если это не сработает, прокомментируйте и не нажимайте эту кнопку - 1 мгновенно

0
ответ дан 5 December 2019 в 09:33

Теги

Похожие вопросы