Formatting hard drive works on windows, not on linux

2

Alright this is driving me crazy.

About a month ago I finally migrated to Linux almost exclusively (I only use windows for gaming these days) and so decided to migrate my data storage as well. I have a truecrypt encrypted volume already which I have been using as my primary storage. I also had a leftover bitlocker hd from my Windows days that I don't need anymore so I decided to convert it into a backup device. In essence what I wanted was to format both drives as encrypted drives either using truecrypt or cryptsetup. Alas when I try to create the filesystem on the bitlocker disk (after removing all the partitions from it first and creating new ones) I get this error:

[devicename] is apparently in use by the system; will not make a filesystem here!

And yet... nothing is using it. Its not mounted, there is nothing indicating that device is in use. I tried using Arch Linux installation disk to format it. Same problem. Gnome disk tool. Ditto. Yet when trying out windows version of truecrypt everything works out fine.

Contents if mount:

proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sys on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
dev on /dev type devtmpfs (rw,nosuid,relatime,size=4024460k,nr_inodes=1006115,mode=755)
run on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755)
/dev/mapper/lvmpool-root on / type ext4 (rw,relatime,discard,data=ordered)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/net_cls type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=23,pgrp=1,timeout=300,minproto=5,maxproto=5,direct)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime)
mqueue on /dev/mqueue type mqueue (rw,relatime)
tmpfs on /tmp type tmpfs (rw)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,relatime)
configfs on /sys/kernel/config type configfs (rw,relatime)
/dev/sda3 on /boot type ext4 (rw,relatime,discard,data=ordered)
/dev/mapper/lvmpool-home on /home type ext4 (rw,relatime,discard,data=ordered)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=806084k,mode=700,uid=1000,gid=1000)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
truecrypt on /tmp/.truecrypt_aux_mnt1 type fuse.truecrypt (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other)
/dev/mapper/truecrypt1 on /media/truecrypt1 type fuseblk 

(rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096)

I wonder if bitlocking the device left behind something on the drive I specifically need to remove in order to successfully format it? If so: what, why and how to remove it?

Tomkarho

Posted 2014-12-20T23:49:22.050

Reputation: 231

3You should dd zeroes over the first and last 10MB of the drive, then reboot – Eugen Rieck – 2014-12-20T23:56:15.413

Have you created a new partition table in Gparted? – JohnnyVegas – 2014-12-21T01:38:27.833

@EugenRieck I decided to empty the entire drive overnight with dd and seemed to work. – Tomkarho – 2014-12-21T11:19:13.443

Answers

-1

[devicename] is apparently in use by the system; will not make a filesystem here!

only means that a device of the same name, at some point in the past, was part of a RAID array, hence it cannot be formatted. To check, use

  cat /proc/mdstat

to see whether the device name is included in an array. If (as I surmise) it is, stop the array,

   mdadm -vS /dev/mdxxx

and now you can format your disk.

MariusMatutiae

Posted 2014-12-20T23:49:22.050

Reputation: 41 321

While this might be one of the possible reasons for this error message, it definitly is not applicable here: The OP explicitly mentioned a bitlocker drive. – Eugen Rieck – 2014-12-21T19:24:02.787

@EugenRieck A statement ripe with unproven assumptions: first, that Bitlocker does not work on RAID arrays; second, that the disk does not itself contain a RAID array; third, that the disk as a whole was never used in a RAID array. Besides, to the best of my knowledge, once every normal use of the disk has been ruled out as a consequence of its not being mounted, its belonging to a RAID array is the only reported cause for the appearance of this diagnostic. – MariusMatutiae – 2014-12-21T19:39:44.813