Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am using LVM on my debian 5 server and tried to create a new disk with a partition and a filesystem.

server:/# pvs
  PV         VG      Fmt  Attr PSize   PFree  
  /dev/sda2  primary lvm2 a-   930,75G 132,76G
server:/#lvcreate -L200GB -ndata1 primary
  Logical volume "data1" created
server:/#losetup /dev/loop0 /dev/primary/data1
server:/#fdisk /dev/loop0

keystrokes: n, p, 1 ENTER, ENTER, w
server:/#fdisk -l /dev/loop0
Disk /dev/loop1: 214.7 GB, 214748364800 bytes
255 heads, 63 sectors/track, 26108 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x5e5e8856

      Device Boot      Start         End      Blocks   Id  System
/dev/loop0p1   1       26108   209712478+  83  Linux

Everything ok so far.. now:

server:/#mkfs.ext3 /dev/loop0p1
mke2fs 1.41.3 (12-Oct-2008)

Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
13107200 inodes, 52428119 blocks
2621405 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
1600 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks: 
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
    4096000, 7962624, 11239424, 20480000, 23887872
Writing inode tables: done

..and then it hangs :/

Now i have a process called loop0 using up all of one cpu. I have tried to:

server:/#losetup -d /dev/loop0

but it fails.

unload the loop module using modprobe, fails.

kill -9 the loop process, no dice.(would have tried to kill mkfs.ext3 but seems to have ended)

Remove the lvm volume using lvremove, fails miserably.

Can anyone tell me what I did wrong, how do I avoide this problem in the future and can I remove the process/device without restarting the server?

share|improve this question
Partitioning LVs? Friends don't let friends partition LVs. You don't get charged by the block device. –  womble Jul 21 '11 at 21:42
add comment

1 Answer

If a process hangs when it calls a system function, it's not killable. Your only hope is it will die of itself. If something ignored kill -9 it is not killable, I'm afraid.

I wonder, why did you do: #losetup /dev/loop0 /dev/primary/data1? /dev/primary/data1 is a very nice block device, which you could've used directly for all further commands. If there's one thing I'd change in your procedure that would be avoiding the loopback and working directly with the logical volume.

share|improve this answer
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.