Drakevr's Corner

Me in Hashtags: #sysadmin, #programming, #networking, #student, #Linux

/dev/sdx is apparently in use by the system.

Feb 26, 2012 - 1 minute read - Comments - raiddisk

Greetings programs, in today’s post i will present a little issue i had with
an old box i needed to format and reuse:

root@nibelheim:~# mkfs.ext4 /dev/sdxy
mke2fs 1.41..12 (17-May-2010)
/dev/sdxy is apparently in use by the system; will not make a filesystem here!

this one might get triggered by a number of factors:
1. the drive could be mounted on the current system.
2. there are raid array data left marking the drive or partition as “in use”.

Disk /dev/md127: 10.5 GB, 10536091648 bytes
255 heads, 63 sectors/track, 1280 cylinders, total 20578304 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
Disk identifier: 0x00000000

Disk /dev/md127 doesn't contain a valid partition table

and here is our ‘little’ problem.

As you can see my case falls under the second “category”, there are some raid data left on the device,
now that we know what the problem is we can proceed with the solution.

root@nibelheim:~# mdadm --remove /dev/md127
root@nibelheim:~# mdadm --stop /dev/md127  
mdadm: stopped /dev/md127

then it was a simple:

root@nibelheim:~# mkfs.ext4 /dev/sdxy

and the driver was ready and formated :)

Tags:

Of tabs and spaces. Fosscomm 2012 at Serres

comments powered by Disqus