LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 07-18-2005, 08:46 AM   #1
jackpal
Member
 
Registered: Oct 2003
Location: Florida USA
Distribution: Fedora, RHEL
Posts: 57

Rep: Reputation: 15
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.
 
Old 07-18-2005, 09:39 AM   #2
WhatsHisName
Senior Member
 
Registered: Oct 2003
Location: /earth/usa/nj (UTC-5)
Distribution: RHL9;F1-10; CentOS4-5; DebianSarge-Squeeze
Posts: 1,151

Rep: Reputation: 46
You need to unmount the partition (e.g., boot into rescue mode) before fdisk can delete it.
 
Old 07-18-2005, 11:57 AM   #3
jackpal
Member
 
Registered: Oct 2003
Location: Florida USA
Distribution: Fedora, RHEL
Posts: 57

Original Poster
Rep: Reputation: 15
Thumbs up

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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What app can REALLY delete a partition? (not fdisk, parted, etc...) kornerr Linux - General 4 05-28-2005 12:14 PM
Partition with fdisk fails!? nr5 Linux - Software 12 01-11-2005 02:03 PM
How do I partition on fdisk? Sa3atsky Slackware 4 09-10-2004 06:47 PM
fdisk partition blackzone Linux - Newbie 6 08-22-2004 07:47 AM
I can't get rid of linux, can't delete partition with fdisk Dachy Linux - Newbie 14 05-05-2004 01:25 PM


All times are GMT -5. The time now is 08:31 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration