LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Cannot delete partition with fdisk (https://www.linuxquestions.org/questions/linux-hardware-18/cannot-delete-partition-with-fdisk-344259/)

jackpal 07-18-2005 08:46 AM

Cannot delete partition with fdisk
 
We are having a strange problem with fdisk. All we want to do is delete partition /dev/sda8 but the changes are not taking. See output below:
-----------------------------------------------------------------------
[root@orla240a root]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 9.6G 1.4G 7.7G 15% /
/dev/sda1 486M 16M 445M 4% /boot
/dev/sda6 9.6G 1.1G 8.0G 12% /home
none 188M 0 187M 0% /dev/shm
/dev/sda8 7.6M 1.1M 6.1M 15% /vmimages

[root@orla240a root]# fdisk /dev/sda

The number of cylinders for this disk is set to 17834.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/sda: 255 heads, 63 sectors, 17834 cylinders
Units = cylinders of 16065 * 512 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 64 514048+ 83 Linux
/dev/sda2 65 1339 10241437+ 83 Linux
/dev/sda3 1340 1437 787185 82 Linux swap
/dev/sda4 1438 17834 131708902+ f Win95 Ext'd (LBA)
/dev/sda5 1438 2967 12289693+ fb Unknown
/dev/sda6 2968 4242 10241406 83 Linux
/dev/sda7 4243 4255 104391 fc Unknown
/dev/sda8 4256 4256 8001 83 Linux

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): d
Partition number (1-8): 8

Command (m for help): p

Disk /dev/sda: 255 heads, 63 sectors, 17834 cylinders
Units = cylinders of 16065 * 512 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 64 514048+ 83 Linux
/dev/sda2 65 1339 10241437+ 83 Linux
/dev/sda3 1340 1437 787185 82 Linux swap
/dev/sda4 1438 17834 131708902+ f Win95 Ext'd (LBA)
/dev/sda5 1438 2967 12289693+ fb Unknown
/dev/sda6 2968 4242 10241406 83 Linux
/dev/sda7 4243 4255 104391 fc Unknown

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

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.
Syncing disks.

-----------------------------------------------------------------------
REBOOTED HERE
----------------------------------------------------------------------
[root@orla240a root]# fdisk /dev/sda

The number of cylinders for this disk is set to 17834.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/sda: 255 heads, 63 sectors, 17834 cylinders
Units = cylinders of 16065 * 512 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 64 514048+ 83 Linux
/dev/sda2 65 1339 10241437+ 83 Linux
/dev/sda3 1340 1437 787185 82 Linux swap
/dev/sda4 1438 17834 131708902+ f Win95 Ext'd (LBA)
/dev/sda5 1438 2967 12289693+ fb Unknown
/dev/sda6 2968 4242 10241406 83 Linux
/dev/sda7 4243 4255 104391 fc Unknown
/dev/sda8 4256 4256 8001 83 Linux

Command (m for help): q

[root@orla240a root]# exit
-----------------------------------------------------------------------
Notice /dev/sda8 is back after the reboot. Anybody know why?

Here is our kernel version via uname -a :
[root@orla240a root]# uname -a
Linux orla240a.ww007.siemens.net 2.4.9-vmnix2 #1 Thu Mar 17 16:09:37 PST 2005 i686 unknown

I should also mention this is a VMWARE ESX Server Host.

WhatsHisName 07-18-2005 09:39 AM

You need to unmount the partition (e.g., boot into rescue mode) before fdisk can delete it.

jackpal 07-18-2005 11:57 AM

Yep, thanks thats what it was. turned out the ESX server application kept mounting the drive up on its own. Fixed it by commenting the mount out of /etc/fstab. Then rebooted and the changes took.


All times are GMT -5. The time now is 12:08 PM.