D
D
Denis2017-11-22 10:23:41
linux
Denis, 2017-11-22 10:23:41

Why won't the disk be formatted and mounted in Linux?

There is a server on Debian. I add a 3TB hard disk (one 3TB disk is already there).
cfdisk make a gpt partition and try to format it:
# mkfs.ext4 /dev/sdbb1
I get an error:

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

We carry the disk to another machine with gui, create a gpt partition, format ext4 - everything is mounted well, files / folders are created.
We connect to the server and look at fdisk:
# fdisk -l /dev/sdbb
Disk /dev/sdbb: 2,7 TiB, 3000592982016 bytes, 5860533168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: D5070E08-C07A-4407-AA88-6FD4DBBDDAB7

Device     Start        End    Sectors  Size Type
/dev/sdbb1  2048 5860532223 5860530176  2,7T Linux filesystem

Trying to mount:
#mount /dev/sdbb1 /mnt/local-hdd/
mount: /dev/sdbb1 is already mounted or /mnt/local-hdd busy

What could be the problem?
PS when connecting a disk (on a live sata) we have on the console:
5a152598157c4900604890.jpeg
Added:
Feeling that the disk is part of the raid and these accessories are registered in the header.
In this regard, the question is:
How to overwrite this data in Linux?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
D
Denis, 2017-12-06
@Hoper

Here's what the solution was:
Multipath is to blame for everything, it is he who "holds" the disk for change.
...

3600304800f704e0021ba6c54160d09df dm-2 SMC,SMC2108
size=2.7T features='1 retain_attached_hw_handler' hwhandler='0' wp=rw
`-+- policy='service-time 0' prio=1 status=active
  `- 0:2:0:0   sda  8:0    active ready running

...
here from our sda
we blacklist this disk for multipath
#vim /etc/multipath.conf (если нет - создать)
blacklist {
       wwid 3600304800f704e0021ba6c54160d09df
}

for more information link
#/etc/init.d/mutlipath-tools restart
#multipath -ll

the disk is missing and available for formatting and mounting.
Something like that...

A
Alexander Semenenko, 2017-11-22
@semenenko88

As I understand it, the disk is already mounted somewhere, look at mount without parameters, or like this:
mount | grep sdbb

C
CityCat4, 2017-11-22
@CityCat4

The message on the screen in English on white says that when reading the partition table, an I / O error occurs. (sector 0 and sector 2048 are the same). Either the machine does not understand disks > 2Tb in size, or there is actually a failure. Check the beginning of the disc with Victoria.

S
Sly_tom_cat ., 2017-11-22
@Sly_tom_cat

Yes, some unhealthy mentions about dm-47... it's most likely some scraps from RAID getting in the way...
You can go in two ways:
1. wipe the first 2048 sectors and the last ones on the disk with zeros, and only after that make a partition table and mark up the section.
2. remove from mdadm systems and everything connected with it. But it's like shooting at sparrows from a howitzer...
You can erase the disk with the dd command, something like
dd if=/dev/zero of=/dev/sdbb bs=512 count =2048
To erase the end, you also need to set an offset ( it must be calculated based on the size of the disk).
dd if=/dev/zero of=/dev/sdbb bs=512 count =2048 seek=<calculated block count>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question