Take the 2-minute tour ×

I was trying to add a swap partition in my secondary drive, I created the partition space with fdisk and when running mkswap I was greeted with an error:

$ sudo mkswap -c /dev/sdb2
/dev/sdb2: No such file or directory

In fact the device doesn't exist:

$ ls /dev/sda*
$ ls /dev/sdb*
/dev/sdb  /dev/sdb1

fdisk confirms me that the partition exists:

$ sudo fdisk /dev/sdb

Command (m for help): p

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048   419432447   209715200   83  Linux
/dev/sdb2       419432448   429918207     5242880   82  Linux swap / Solaris

I'm running Ubuntu 11.10, I thought that udev would manage the devices automatically, should I still use MAKEDEV, or there is a new method to handle this problem?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

Does sudo partprobe in a terminal do anything? I believe fdisk is supposed to do it for you when you exit but maybe it didn't.

Anything in dmesg about the new partition or a reason why it hasn't added the device node?

MAKEDEV is not the answer. Even if it works temporarily, it'll be gone after a reboot if there's a deeper problem.

share|improve this answer
I just rebooted before I saw your answer and now the device is created, since I've more space in the device I will try to create a new one and test partprobe. Yes, I suspected in fact that MAKEDEV was obsoleted, that's why I posted the question. Thank you @Caesium. –  stivlo Nov 26 '11 at 15:32
I've created /dev/sdb3 and noticed WARNING: Re-reading the partition table failed with error 16: Device or resource busy. The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8) Syncing disks. sudo partprobe took about 4 minutes to complete, after that /dev/sdb3 was available. –  stivlo Nov 26 '11 at 15:40
Great :) 4 minutes sounds a fairly long time, maybe a suspect disk is taking a while to respond. I'd check the SMART details if I were you :) –  Caesium Nov 26 '11 at 15:42
I will check, but I think it's for the floppy, which I don't have: Warning: Unable to open /dev/fd0 read-write (Read-only file system). /dev/fd0 has been opened read-only. - Unfortunately seems there is something wrong with the BIOS which messes up the settings every time I start the PC. –  stivlo Nov 26 '11 at 15:45
The SMART short test said completed without error, I am now running a long test, with ETA 4h. Will see.. thanks. –  stivlo Nov 26 '11 at 16:02
add comment

Your Answer


