LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-10-2016, 01:03 PM   #1
JockVSJock
Senior Member
 
Registered: Jan 2004
Posts: 1,420
Blog Entries: 4

Rep: Reputation: 164Reputation: 164
Question fdisk shows no free sectors available, however a reboot fixes it, why?


A partition has run out of space on a RHEL5 VM:

Code:
/dev/mapper/VolGroup01-LogVol00
                       26G   22G   25G  98% /ora

Using blkid, pvs, vgs, lvs and df -ha, I confirm the Physical Volume, Logical Volume and Group Volume and increase the disk size in vCenter.

Using fdisk, I try to create another primary partition (we only can create 3 primary and one logical)


Code:
Disk /dev/sdg: 26.6 GB, 26687091200 bytes


   Device Boot      Start         End      Blocks   Id  System
/dev/sdg1               1        1698    13631487+  8e  Linux LVM
/dev/sdg2            1698        3394    13630817   8e  Linux LVM

However when I go to add /dev/sdg3, I get the following from fdisk

Code:
fdisk no free sectors available

I try to run partprobe, hoping this would pick up space added to the data disk no nothing.

For the hell of it, I reboot and I try fdisk again and I'm able to proceed to add the new partition and using LVM successfully grow the disk.

I don't understand why fdisk wasn't allowing for the creation of the new disk, however a reboot fixed it...?
 
Old 08-10-2016, 01:52 PM   #2
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
Probably tmp files got deleted.
 
Old 08-10-2016, 05:51 PM   #3
JockVSJock
Senior Member
 
Registered: Jan 2004
Posts: 1,420

Original Poster
Blog Entries: 4

Rep: Reputation: 164Reputation: 164
Quote:
Originally Posted by Emerson View Post
Probably tmp files got deleted.
I'm not sure what tmp files that you are referring to?
 
Old 08-10-2016, 06:44 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,125

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Hard disks traditionally didn't get bigger during running. You powered a machine down and swapped out the disk.
More recent versions are more amenable to this. From your own description, partprobe did nothing, so fdisk had nothing new to work with.
 
Old 08-10-2016, 07:14 PM   #5
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,976

Rep: Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623
Some program locked the space?
 
Old 08-10-2016, 07:15 PM   #6
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,140

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
The kernel keeps a copy of the partition table. After making changes to the disk you need to reread the table by doing the command below. Reboot fixes this as well.

Code:
blockdev --rereadpt /dev/sdg

It is not uncommon to use this in a SAN when a disk has been made larger.
 
Old 08-10-2016, 08:42 PM   #7
JockVSJock
Senior Member
 
Registered: Jan 2004
Posts: 1,420

Original Poster
Blog Entries: 4

Rep: Reputation: 164Reputation: 164
Quote:
Originally Posted by smallpond View Post
The kernel keeps a copy of the partition table. After making changes to the disk you need to reread the table by doing the command below. Reboot fixes this as well.

Code:
blockdev --rereadpt /dev/sdg

It is not uncommon to use this in a SAN when a disk has been made larger.

I couldn't even add a partition of 25 GB. I had to reboot first and then I was able to add the partition of 25 GB, ran partprobe and then went thru the LVM steps successfully.

And yes you are correct, this is all SAN storage.
 
Old 08-11-2016, 03:04 AM   #8
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Quote:
Originally Posted by JockVSJock View Post
Using blkid, pvs, vgs, lvs and df -ha, I confirm the Physical Volume, Logical Volume and Group Volume and increase the disk size in vCenter.

I don't understand why fdisk wasn't allowing for the creation of the new disk, however a reboot fixed it...?
Quote:
Originally Posted by syg00 View Post
Hard disks traditionally didn't get bigger during running. You powered a machine down and swapped out the disk.
More recent versions are more amenable to this. From your own description, partprobe did nothing, so fdisk had nothing new to work with.
That ^^^^^

VMs (unless the "guest" OS has been specifically patched / moduled to be aware of their underlying virtualization platform) will only detect changes to the disk size when rebooted, or in the case of Citrix XenServer restarted.
 
  


Reply

Tags
fdisk, free sectors, lvm, rhel 5



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
re-allocated sectors count shows 2 bad sectors, in Ubuntu 10.04 disk utility james2b Linux - Hardware 4 10-12-2010 11:16 PM
fdisk -- no free sectors available; i have a few gigs free??? lowpro2k3 Linux From Scratch 5 02-03-2009 12:43 AM
fdisk and unallocated sectors Alien_Hominid Linux - Hardware 2 02-06-2006 11:07 PM
fdisk: no sectors available? ? ? ic_torres Linux - Hardware 5 12-29-2005 05:08 PM
fdisk "No free sectors Available" xfezz Linux - General 3 04-21-2005 09:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:55 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration