can not format new partition [old superblocks]

Bug #342777 reported by Kjella
2
Affects Status Importance Assigned to Milestone
gparted (Ubuntu)
Invalid
Undecided
Unassigned
mdadm (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: mdadm

For some reason, gparted fails to format a new partition where I used to have an old, deleted RAID set. To reproduce (maybe):

1. Create raid1 set with mdadm (/dev/sdd1 and /dev/sde1)
2. Delete partition (/dev/sdd1)
3. Reboot (just to make sure /dev/sdd1 should be gone everywhere)
4. Try to create a new ext3 formatted partition using gparted

Expected: Create and format succeeds
Actual: mkfs fails with: "/dev/sdd1 is apparently in use by the system: will not make a file system here" that was just created?!

I'm not sure where the real problem is, if it's in mkfs, gparted, mdadm, the kernel, but somewhere it's keeping traces of sdd1 which prevents me from using the disk. mdadm says the raid set is not active so it won't let met do anything with it there, gparted refuses to work so I'm stuck.

mdadm:
  Installed: 2.6.3+200709292116+4450e59-3ubuntu3.1

Revision history for this message
Kjella (kjella79) wrote :
Revision history for this message
ceg (ceg) wrote :

With mdadm --zero-superblock you can remove md info from the partition (prior to deleting the partition table entry)

Otherwise dd zeros to the partition or try to use the --force mkfs/gparted.

summary: - Old raid array blocks format of new partition
+ old superblocks can prevent formating a new partition
Changed in mdadm (Ubuntu):
status: New → Confirmed
summary: - old superblocks can prevent formating a new partition
+ old raid superblocks can prevent formating a new partition
ceg (ceg)
summary: - old raid superblocks can prevent formating a new partition
+ can not format new partition [old superblocks]
Revision history for this message
Phillip Susi (psusi) wrote :

It appears that mdadm is still attached to the partition. You need to either mdadm --stop and/or --zero-superblock to make it stop using the partition.

Changed in mdadm (Ubuntu):
status: Confirmed → Invalid
Changed in gparted (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.