Unable to create filesystem on new partition - Amazon EC2 instance

0

I created a new partition /dev/xvda1p1 on linux amazon ami. After that i am unable to create a filesystem.

What is the issue?

# fdisk -l

Disk /dev/xvda1: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x3ace0183

  Device Boot      Start         End      Blocks   Id  System
/dev/xvda1p1               1          14      112423+  83  Linux

# mkfs.ext4 /dev/xvda1p1
mke2fs 1.41.12 (17-May-2010)
Could not stat /dev/xvda1p1 --- No such file or directory

The device apparently does not exist; did you specify it correctly?

P K

Posted 2011-12-21T07:08:13.780

Reputation: 1 753

Answers

0

Try tricks:

  • udevadm trigger to make udev look for new devices and create /dev/xvda1p1
  • blockdev --rereadpt /dev/xvda1 to explicitly tell it to re-read partition table on it
  • mknod /dev/xvda1p1 b ${some_number} ${some_number2} manually. ${some_number} is probably the same as in /dev/xvda1 and ${some_number2} is like /dev/xvda1's, but +1.
  • Finally, you can losetup -o ${some_offset} /dev/loop0 /dev/xbda1 and use /dev/loop0. ${some_offset} is probably 8225280.

Vi.

Posted 2011-12-21T07:08:13.780

Reputation: 13 705

great, i will try this, but what is the root cause of problem? – P K – 2011-12-21T09:37:35.033

That the /dev/xbda1p1 file does not exist. Normally kernel should detect partitions on a device and udev should create nodes in /dev/ for them. – Vi. – 2011-12-21T10:23:05.843

partprobe for informing kernel is also not working in my case – P K – 2011-12-21T15:14:48.480

>blockdev --rereadpt /dev/xvda1

BLKRRPART: Invalid argument – P K – 2011-12-21T15:22:02.633