2

I'm trying to test restoring a backed up linux file system /apps (ext3 filesystem)

/dev/cciss/c0d0p7     177G  3.8G  164G   3% /apps

I ran the following command to take a dump:

/sbin/dump -0uz -f /backup_labeir1/apps.dmp /apps

Then I deleted the /apps folder:

rm -rf /apps

And unmounted it:

umount -l /apps

Next I'm trying to make the file-system

mke2fs -j -b 4096 -L data /dev/cciss/c0d0p7

after which I'm planning to do the below steps:

# mkdir /apps
# mount -t ext3 /dev/cciss/c0d0p7 /apps
# cd /apps
# restore -rf /backup_labeir1/apps.dmp .
# reboot

I've 2 questions:

  1. Are my testing steps correct
  2. When I run the below I get the error: [root@labeir2 backup_labeir1]# mke2fs -F -j -b 4096 -L data /dev/cciss/c0d0p7 mke2fs 1.39 (29-May-2006) /dev/cciss/c0d0p7 is apparently in use by the system; mke2fs forced anyway. /dev/cciss/c0d0p7: Device or resource busy while setting up superblock

But neither the filesystem is mounted nor lsof shows me any output:

 lsof | grep /dev/cciss/c0d0p7
 lsof /dev/cciss/c0d0p7

Please help me resolve this.

dig_123
  • 265
  • 3
  • 11

2 Answers2

2

I got the same error when I tried to format a USB drive on Mac OS X. In my case, unmounting the disk first with diskutil unmountDisk ... solved the problem.

Details: First, run diskutil list and check the output to figure out which disk you want to format. (Don't format your hard drive disk0!) In my case, it was /dev/disk1. When I first ran mkfs.ext3 /dev/disk1, I got the message "Resource busy while setting up superblock". But after I ran diskutil unmountDisk disk1, mkfs.ext3 worked.

Note: Initially, I tried diskutil eject disk1, but then the disk is not accessible anymore - e.g. diskutil list doesn't show it. diskutil unmountDisk disk1 makes sure that the disk is no longer in use, but mkfs.ext3 can still access it.

0

/dev/cciss/c0d0p7: Device or resource busy while setting up superblock

From my experience, resource busy cause by multipath device map(might have). (e.g. /dev/mapper/mpathi)

If we have this problem, "mke2fs -t ext4 /dev/mapper/mpathi" and "" will fail.

[root@myserver ~]# multipath -ll mpathi
mpathi (snip:myFCdisk) dm-6 snip:myFCdiskProdName
size=100G features='0' hwhandler='1 alua' wp=ro
|-+- policy='round-robin 0' prio=snip:123 status=active
| `- 6:0:0:7  sdv  65:80  active ready  running
`-+- policy='round-robin 0' prio=snip:111 status=enabled
  `- 5:0:0:7  sdi  8:128  active ready  running
[root@myserver ~]#
[root@myserver ~]# mke2fs -F -t ext4 /dev/mapper/mpathi
mke2fs 1.41.12 (17-May-2010)
/dev/mapper/mpathi: Operation not permitted while setting up superblock
[root@myserver ~]#
[root@myserver ~]# mke2fs -F -t ext4 /dev/sdv
mke2fs 1.41.12 (17-May-2010)
/dev/sdv is apparently in use by the system; will not make a filesystem here!
[root@myserver ~]#

My workaround is removing multipath device map temporarily.

  1. remove multipath device name.(multipath -f /dev/mapper/mpathi)
  2. run mke2fs for mpath slave device(e.g. mke2fs -F -t ext4 /dev/sdv)
  3. rebuild multipath device map.(multipath -r)

Have a good day:)