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

Or an alternate title for this post could be… “LSI, the raid controller I won’t purchase again”… or “MPIO, piss off”

Anyways, in the process of adding 4 new 600GB SAS drives to an x3550 M2 server I encountered a small error. After installing the drives into the machine, creating the raid, and rebooting something was amiss.

fdisk -l

Disk /dev/sda: 1197.9 GB, 1197998080000 bytes
255 heads, 63 sectors/track, 145648 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb: 145.9 GB, 145999527936 bytes
255 heads, 63 sectors/track, 17750 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1         867     6964146   83  Linux
/dev/sdb2             868       17495   133564410   83  Linux
/dev/sdb3           17496       17750     2048287+  82  Linux swap / Solaris

Disk /dev/dm-0: 1197.9 GB, 1197998080000 bytes
255 heads, 63 sectors/track, 145648 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Now my initial thought was, “what the hell is /dev/dm-0″ but i moved ahead and tried fdisk anyways. At first I attempted to create a new primary partition and upon writing it out I got a wonderful error that i forgot to copy. Moral of the story, time to install 26 firmware updates.

This is usually a painful task but the IBM UpdateExpress is in fact the bees knees.

All you need is the following two commands and you are home free with all your Firmware and Driver updates.

./uxspi440.rhel5 ac

./uxspi440.rhel5 co

After some on screen instructions/user input it will do most everything for you. Thank you IBM

After installing the small army of FW and Driver updates I tried again

fdisk /dev/sda

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-145648, default 1): 
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-145648, default 145648): 
Using default value 145648

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

YAY, successories. The partition has been created lets create the filesystem.

mkfs.ext3 /dev/sda
/dev/sda1 is apparently in use by the system; will not make a filesystem here!

Of course looking at mount or fuser /dev/sda1 resulted in no information the drive wasn’t mounted anywhere or in use.

But after many days of working late I finally came back to that damned /dev/dm-0. Some further google fu resulted in the following two commands.

dmsetup status

dmsetup ls

This showed that there were several mpath devices configured on the system. Since this system is not using software RAID or MPIO this is a problem it should only return

# dmsetup ls
No devices found

# dmsetup status
No devices found

So the final fix this, tell MPIO and Multipath to get the hell out of your system by editing /etc/multipathd.conf and adding the following.

blacklist {
devnode '*'
}

Reboot the server, the /dev/dm-0 will be gone.

And you can run mkfs.ext3 /dev/sda1 and then go outside and run in a field.

May be just me, but I believe a driver for a RAID controller should maybe… just maybe check for that during the install. oh well.

14 thoughts on “/dev/sda1 is apparently in use by the system; will not make a filesystem here!

  1. Petter says:

    I had the same issue after reusing a disk coming as a non-raid disk from a vmware server with an LSI raid card. On my Linux, the /etc/multipathd.conf already had the blacklist statement, but this did the trick:

    [root@computer ~]# dmsetup ls
    ddf1_4c53492020202020100000791000929047114711f2384c82 (253, 0)
    [root@computer ~]# dmsetup remove ddf1_4c53492020202020100000791000929047114711f2384c82
    [root@computer ~]# dmsetup ls
    No devices found

    After that, fdisk and mkfs the normal way…

    Reply
    • Rick says:

      Hi Peter,

      We have a similar problem, how would you distinguish which one is the right one? We have 2x devices attached (ISCSI) with multipathing enabled which need to stay on however for some reason /dev/sdb has been hijacked by it.

      If i run multipath -ll:

      360022190b932d3001662829b0d4a25c1dm-0 DELL,PERC 6/i Adapter
      [size=837G][features=0][hwhandler=0]
      \_ round-robin 0 [prio=1][active]
      \_ 0:2:1:0 sdb 8:16 [active][ready]
      1494554000000000065773710427df8cbf477702750cc2014dm-1 IET,VIRTUAL-DISK
      [size=2.7T][features=0][hwhandler=0]
      \_ round-robin 0 [prio=1][active]
      \_ 5:0:0:0 sdc 8:32 [active][ready]
      1494554000000000000000000010000003a5d02000100900034434536373630dm-2 IET,VIRTUAL-DISK
      [size=2.7T][features=0][hwhandler=0]
      \_ round-robin 0 [prio=1][active]
      \_ 6:0:0:0 sdd 8:48 [active][ready]

      The top one needs to go, if i run demsetup ls:

      VG_XenStorage–e74edb65–8294–507b–1b58–b932d5a201c2-VHD–fa6ef314–f0c9–4eb0–aac5–0a147a28dd78 (251, 7)
      360022190b932d3001662829b0d4a25c1 (251, 0)
      VG_XenStorage–e74edb65–8294–507b–1b58–b932d5a201c2-VHD–22f5f044–1913–492e–bd02–16ba02b76166 (251, 14)
      VG_XenStorage–e74edb65–8294–507b–1b58–b932d5a201c2-VHD–b7d7b6f5–63ad–4feb–ac2a–0e50e2c7ae23 (251, 17)
      VG_XenStorage–e74edb65–8294–507b–1b58–b932d5a201c2-VHD–bd033661–d852–4085–9d17–37d441115ac5 (251, 10)
      VG_XenStorage–e74edb65–8294–507b–1b58–b932d5a201c2-VHD–ff0cb416–09a3–4796–80f9–808f6ee454ef (251, 9)
      VG_XenStorage–2c62904a–6f5f–ffca–c848–78ed314f7899-VHD–c1ace336–820b–4995–830f–7455b66457a5 (251, 15)
      VG_XenStorage–e74edb65–8294–507b–1b58–b932d5a201c2-VHD–725e6bce–5b35–42c0–96a5–24cdfa03eac7 (251, 6)
      VG_XenStorage–e74edb65–8294–507b–1b58–b932d5a201c2-VHD–7ab56473–5297–4e24–9767–8f5e789d22ab (251, 13)
      VG_XenStorage–e74edb65–8294–507b–1b58–b932d5a201c2-VHD–2cd8bb62–f6d3–4489–abe2–ca3f4aba28fe (251, 8)
      VG_XenStorage–e74edb65–8294–507b–1b58–b932d5a201c2-VHD–a645c7c0–94b4–4513–b3c2–350d36feca04 (251, 19)
      VG_XenStorage–e74edb65–8294–507b–1b58–b932d5a201c2-VHD–720da862–e4e4–4140–ac0f–4dfdc1410e4c (251, 20)
      VG_XenStorage–e74edb65–8294–507b–1b58–b932d5a201c2-VHD–51b2d066–f8b3–4902–981c–fcf4f20ce636 (251, 4)
      VG_XenStorage–e74edb65–8294–507b–1b58–b932d5a201c2-VHD–10c1266d–9fe7–4aa9–bc8f–39028a58df48 (251, 5)
      VG_XenStorage–2c62904a–6f5f–ffca–c848–78ed314f7899-VHD–50f7f3a1–b3c8–4394–9cb4–137f5194ab6c (251, 16)
      1494554000000000065773710427df8cbf477702750cc2014 (251, 1)
      VG_XenStorage–e74edb65–8294–507b–1b58–b932d5a201c2-VHD–6ed7dc45–2dff–4a84–b1f0–ea71d25e24dc (251, 3)
      VG_XenStorage–e74edb65–8294–507b–1b58–b932d5a201c2-VHD–47dc9581–0538–4040–aa31–76828a243339 (251, 21)
      VG_XenStorage–e74edb65–8294–507b–1b58–b932d5a201c2-VHD–359a217d–539c–4f3a–ad91–d5a019f83159 (251, 18)
      VG_XenStorage–e74edb65–8294–507b–1b58–b932d5a201c2-VHD–407bd056–e106–453a–9d93–d45df2bde472 (251, 11)
      1494554000000000000000000010000003a5d020001009000344345363736303041463332 (251, 2)
      VG_XenStorage–e74edb65–8294–507b–1b58–b932d5a201c2-VHD–b9278186–7194–4a13–977b–7ef58b0ca39f (251, 12)

      There are 3x devices with multpath enabled in the above list but dont know which one is /dev/sdb

      Any help appreciated.

      Rick

      Reply
  2. Tim says:

    You guys are Gods!

    Been messing around for decades trying to work out why I couldn’t format a drive…(forgive me chaps I’m a Windows user….boo hoo.)

    “what the hell is /dev/dm-0″ – I said exactly the same thing – removed and all went fab!!!

    Cheers!

    Reply
  3. Jesse DuPont says:

    Thanks for posting. I’m legitimately using multipath tools for some iSCSI vols that have multiple paths, but your post reminded me I needed to exclude the iSCSI vol I was working on that didn’t have multiple paths. Thanks!

    Reply
  4. Kpiti says:

    Btw, sometimes you do have other dm* devices and just want to exclude some specific volume, then you should use blacklist section in /etc/multipath.conf. For example:

    blacklist {
    device “ATA Hitachi ”
    }

    Reply
  5. Dave says:

    Thanks a lot! Bought a new drive today and couldn’t for the life of me figure out why I couldn’t create a filesystem on it. Running dmsetup ls and dmsetup remove fixed the problem.

    Reply
  6. Dwight says:

    This post was the only one that got me through an exercise on a USB drive!
    Had nothing to do with RAID or /etc/multipath.conf.
    Just needed those dmsetup commands to remove references to the USB drive partitions.
    Thanks very much!

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>