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.

This is Ubuntu server 11.10.

/dev/sdb is not mounted (see outputs below) and is not used by any process that I can see. Its not used for swap as well. This is a 2nd IDE drive in the server, connected to the secondary IDE and set up in hardware raid as array 2.

I cannot mount the drive as I get a complaint it might already be in use. I did run fdisk, deleted all the previous partitions and created a single primary one.

root@sargent:/home/harel# fdisk -l /dev/sdb

Disk /dev/sdb: 122.9 GB, 122942324736 bytes
226 heads, 63 sectors/track, 16864 cylinders, total 240121728 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00083711

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048   240121727   120059840   83  Linux


root@sargent:/home/harel# mkfs -t ext4 /dev/sdb
mke2fs 1.41.14 (22-Dec-2010)
/dev/sdb is entire device, not just one partition!
Proceed anyway? (y,n) y
/dev/sdb is apparently in use by the system; will not make a filesystem here!

root@sargent:/home/harel# cat /proc/swaps 
Filename                Type        Size    Used    Priority
/dev/sda5                               partition   2619388 0   -1

root@sargent:/home/harel# mount
/dev/sda1 on / type ext4 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
share|improve this question
    
You said the drive is part of a RAID array - as long as that array is active, you may not be able to access (e.g. format) the individual drives directly. –  cyberx86 Jan 2 '12 at 22:01
    
Its two separate arrays though. Array 1 is a 40GB drive with Ubuntu etc., and the other drive is set as Array 2. How can I refer to it then? –  Harel Jan 2 '12 at 22:10
1  
You say 'this is the second drive... setup as array 2'. An array is made of more than one disk (you can't have a 1 drive array). If you have two arrays, you should have (at least) 4 disks. You should be able to refer to the arrays (each collection of disks), but not the individual disks themselves, while they are part of an active array. (Perhaps I am misunderstanding your scenario?) –  cyberx86 Jan 2 '12 at 22:19
    
It turns out that in my scenario the 2nd Raid array was set wrong in the raid configuration software. I rebuilt the array and it then mounted correctly. This is an old Fujistu server and although I understand your point regrding 1 drive arrays, it does let me set it up as such. I think its because the IDE drives only have the raid interface to connect to so it doubles up as an IDE interface (just a guess). So, thanks. Your comment about the arrays prompted me to check the bios config. –  Harel Jan 2 '12 at 22:55

1 Answer 1

/dev/sdb is in use because there are partitions on it that the OS is aware of. If you want to create a filesystem on it (a bad idea, because it is rarely done so will confuse administrators, and it will make it difficult to do any kind of splitting or resizing), first remove the existing partition with fdisk. If you want to create a filesystem on the sole partition /dev/sdb1 (this is what you should do, since there is no benefit to using the disk directly), then say what you mean: mkfs /dev/sdb1.

share|improve this answer

Your Answer

 
discard

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.