Partition management via FDISK fails to create partitions

I want to create a swap partition with the Webmin "Paritions on local disks" module, using FDISK, since using PARTED doesn't work for that (error message about "don't use parted to create filesystems..." occurs).

I know I did that successfully in the past, but now, when I try to create a primary Linux Swap partition on an empty (virtual) disk, the GUI hangs, a process "/sbin/fdisk /dev/sdb" is visible in ps, and the Webmin debug log shows:

3290 [28/Jun/2013 16:19:13.521792] root MYIP proc CMD "cmd=/sbin/fdisk /dev/sdb uid= gid="

I guess something's missing there... :) I tried Webmin versions 1.631 and 1.630.

Status: 
Closed (fixed)

Comments

If you SSH in and run fdisk /dev/sdb manually, are you able to create a new partition?

If I type just "fdisk /dev/sdb", it says: "Command (m for help):".

But when I enter the command that Webmin (assumedly, as per debug log and atop) performed, "/sbin/fdisk /dev/sdb uid= gid=", fdisk just prints its Usage information and exits. Incorrect parameters? "man fdisk" doesn't say anything about "uid=" or "gid=".

In case this is helpful:

Welcome to Ubuntu 12.04.2 LTS (GNU/Linux 3.2.0-45-generic x86_64)
root@lyra:~# uname -a
Linux lyra 3.2.0-45-generic #70-Ubuntu SMP Wed May 29 20:12:06 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

What if after running fdisk /dev/sdb you use it to create an additional partition?

If this works, please let me know what commands you ran inside fdisk, and what they output.

Okay, I played a bit with that command, and here's the screendump. I'm a bit surprised though that you'd need that info, because I know with high certainty that I used that Webmin module before to create partitions... Did you break it somehow? ;)

Command (m for help): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)
 
Command (m for help): p
 
Disk /dev/sdc: 5368 MB, 5368709120 bytes
149 heads, 8 sectors/track, 8796 cylinders, total 10485760 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: 0x00047369
 
   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1            2048    10483711     5240832   82  Linux swap / Solaris
 
Command (m for help): n
Partition type:
   p   primary (1 primary, 0 extended, 3 free)
   e   extended
Select (default p): p
Partition number (1-4, default 2): 2
First sector (10483712-10485759, default 10483712):
Using default value 10483712
Last sector, +sectors or +size{K,M,G} (10483712-10485759, default 10485759):
Using default value 10485759
 
Command (m for help): p
 
Disk /dev/sdc: 5368 MB, 5368709120 bytes
149 heads, 8 sectors/track, 8796 cylinders, total 10485760 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: 0x00047369
 
   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1            2048    10483711     5240832   82  Linux swap / Solaris
/dev/sdc2        10483712    10485759        1024   83  Linux
 
Command (m for help): t
Partition number (1-4): 2
Hex code (type L to list codes): L
 
 0  Empty           24  NEC DOS         81  Minix / old Lin bf  Solaris
 1  FAT12           27  Hidden NTFS Win 82  Linux swap / So c1  DRDOS/sec (FAT-
 2  XENIX root      39  Plan 9          83  Linux           c4  DRDOS/sec (FAT-
 3  XENIX usr       3c  PartitionMagic  84  OS/2 hidden C:  c6  DRDOS/sec (FAT-
 4  FAT16 <32M      40  Venix 80286     85  Linux extended  c7  Syrinx
 5  Extended        41  PPC PReP Boot   86  NTFS volume set da  Non-FS data
 6  FAT16           42  SFS             87  NTFS volume set db  CP/M / CTOS / .
 7  HPFS/NTFS/exFAT 4d  QNX4.x          88  Linux plaintext de  Dell Utility
 8  AIX             4e  QNX4.x 2nd part 8e  Linux LVM       df  BootIt
 9  AIX bootable    4f  QNX4.x 3rd part 93  Amoeba          e1  DOS access
 a  OS/2 Boot Manag 50  OnTrack DM      94  Amoeba BBT      e3  DOS R/O
 b  W95 FAT32       51  OnTrack DM6 Aux 9f  BSD/OS          e4  SpeedStor
 c  W95 FAT32 (LBA) 52  CP/M            a0  IBM Thinkpad hi eb  BeOS fs
 e  W95 FAT16 (LBA) 53  OnTrack DM6 Aux a5  FreeBSD         ee  GPT
 f  W95 Ext'd (LBA) 54  OnTrackDM6      a6  OpenBSD         ef  EFI (FAT-12/16/
10  OPUS            55  EZ-Drive        a7  NeXTSTEP        f0  Linux/PA-RISC b
11  Hidden FAT12    56  Golden Bow      a8  Darwin UFS      f1  SpeedStor
12  Compaq diagnost 5c  Priam Edisk     a9  NetBSD          f4  SpeedStor
14  Hidden FAT16 <3 61  SpeedStor       ab  Darwin boot     f2  DOS secondary
16  Hidden FAT16    63  GNU HURD or Sys af  HFS / HFS+      fb  VMware VMFS
17  Hidden HPFS/NTF 64  Novell Netware  b7  BSDI fs         fc  VMware VMKCORE
18  AST SmartSleep  65  Novell Netware  b8  BSDI swap       fd  Linux raid auto
1b  Hidden W95 FAT3 70  DiskSecure Mult bb  Boot Wizard hid fe  LANstep
1c  Hidden W95 FAT3 75  PC/IX           be  Solaris boot    ff  BBT
1e  Hidden W95 FAT1 80  Old Minix
Hex code (type L to list codes): 82
Changed system type of partition 2 to 82 (Linux swap / Solaris)
 
Command (m for help):

Don't forget to do "w" at the end (write and exit), which I omitted here.

Ok, so that looks fine. And also it seems that the swap partition was already there?

What kind of VM was this, and which Linux distro and version is it running?

The swap partition was already there because I had already created it manually, since I needed it. :) For distro see my post #2. Can you specify "what kind"?

By what kind, I mean is the VM Xen, KVM or something else?

Oh, it's VMware ESXi 5.

I haven't been able to re-produce this problem, perhaps because I don't have a VMware ESXi install to test on.

Any chance I could login to one of your VMs that is showing this problem?

Yes, certainly! I'll test it again later when I'm on the PC. IIRC it occurs on my experimental VM, I'll send you root access via Virtualmin.

To add to this, I was able to create a partition just fine yesterday on another VMware VM with Ubuntu 10. Maybe the fdisk syntax has changed from 10 to 12?

EDIT: Root login was sent via Virtualmin "Support Login Privileges".

Thanks for the login - looks like there are a couple of issues here :

  1. On your system, fdisk is by default using sectors instead of cylinders. I fixed this though.

  2. The first cylinder is numbered 2 instead of 1 .. and trying to create a partition starting at cylinder 1 fails! I am still digging into this one.

The next release of Webmin will handle this case properly.

Automatically closed -- issue fixed for 2 weeks with no activity.