LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 03-14-2012, 11:45 PM   #1
stevenl
LQ Newbie
 
Registered: Mar 2012
Posts: 13

Rep: Reputation: Disabled
Disk space full and remedy


Hi,

We have provision 120G for this machine according to our VMware provisioned storage.

However we ran out of space while doing some backup and it is showing only 48G as below. How dowe increase the space?

Last login: Thu Mar 15 13:34:26 2012
root@atraina-alfdrp:~# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/atraina--alfdrp-root
48G 48G 0 100% /
udev 7.9G 4.0K 7.9G 1% /dev
tmpfs 3.2G 536K 3.2G 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 7.9G 0 7.9G 0% /run/shm
/dev/sda1 228M 24M 193M 11% /boot
root@atraina-alfdrp:~#
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 03-15-2012, 12:22 AM   #2
xeleema
Member
 
Registered: Aug 2005
Location: D.i.t.h.o, Texas
Distribution: Slackware 13.x, rhel3/5, Solaris 8-10(sparc), HP-UX 11.x (pa-risc)
Posts: 987
Blog Entries: 4

Rep: Reputation: 252Reputation: 252Reputation: 252
Greetingz!

1) Please use "code" tags around outputs ( [code] & [/code] )
2) What is the output of the following commands?
fdisk -l
pvs
vgs
 
Old 03-15-2012, 12:27 AM   #3
stevenl
LQ Newbie
 
Registered: Mar 2012
Posts: 13

Original Poster
Rep: Reputation: Disabled
Thanks for prompt response. Below the info



root@atraina-alfdrp:~# fdisk -l

Disk /dev/sda: 107.6 GB, 107646812160 bytes
255 heads, 63 sectors/track, 13087 cylinders, total 210247680 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: 0x000d854e

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 499711 248832 83 Linux
/dev/sda2 501758 134215679 66856961 5 Extended
/dev/sda5 501760 134215679 66856960 8e Linux LVM

Disk /dev/mapper/atraina--alfdrp-root: 51.3 GB, 51279560704 bytes
255 heads, 63 sectors/track, 6234 cylinders, total 100155392 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: 0x00000000

Disk /dev/mapper/atraina--alfdrp-root doesn't contain a valid partition table

Disk /dev/mapper/atraina--alfdrp-swap_1: 17.2 GB, 17179869184 bytes
255 heads, 63 sectors/track, 2088 cylinders, total 33554432 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: 0x00000000

Disk /dev/mapper/atraina--alfdrp-swap_1 doesn't contain a valid partition table
root@atraina-alfdrp:~#

root@atraina-alfdrp:~# pvs
PV VG Fmt Attr PSize PFree
/dev/sda5 atraina-alfdrp lvm2 a- 63.76g 0


root@atraina-alfdrp:~# vgs
VG #PV #LV #SN Attr VSize VFree
atraina-alfdrp 1 2 0 wz--n- 63.76g 0
 
Old 03-15-2012, 12:34 AM   #4
TKH
Member
 
Registered: Jul 2011
Location: Milky Way
Distribution: Ubuntu, LFS, Slackware, Fedora
Posts: 218

Rep: Reputation: 20
Ya know, it's hard to read all these if you don't put the "code" tag around your output.
That is what xeleema is trying to say.
 
Old 03-15-2012, 12:41 AM   #5
stevenl
LQ Newbie
 
Registered: Mar 2012
Posts: 13

Original Poster
Rep: Reputation: Disabled
Code:
Thanks for prompt response. Below the info
 


root@atraina-alfdrp:~# fdisk -l
 
Disk /dev/sda: 107.6 GB, 107646812160 bytes
 255 heads, 63 sectors/track, 13087 cylinders, total 210247680 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: 0x000d854e
 
Device Boot Start End Blocks Id System
 /dev/sda1 * 2048 499711 248832 83 Linux
 /dev/sda2 501758 134215679 66856961 5 Extended
 /dev/sda5 501760 134215679 66856960 8e Linux LVM
 
Disk /dev/mapper/atraina--alfdrp-root: 51.3 GB, 51279560704 bytes
 255 heads, 63 sectors/track, 6234 cylinders, total 100155392 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: 0x00000000
 
Disk /dev/mapper/atraina--alfdrp-root doesn't contain a valid partition table
 
Disk /dev/mapper/atraina--alfdrp-swap_1: 17.2 GB, 17179869184 bytes
 255 heads, 63 sectors/track, 2088 cylinders, total 33554432 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: 0x00000000
 
Disk /dev/mapper/atraina--alfdrp-swap_1 doesn't contain a valid partition table
 root@atraina-alfdrp:~#
 
root@atraina-alfdrp:~# pvs
 PV VG Fmt Attr PSize PFree
 /dev/sda5 atraina-alfdrp lvm2 a- 63.76g 0
 

root@atraina-alfdrp:~# vgs
 VG #PV #LV #SN Attr VSize VFree
 atraina-alfdrp 1 2 0 wz--n- 63.76g 0
 
Old 03-15-2012, 01:27 AM   #6
xeleema
Member
 
Registered: Aug 2005
Location: D.i.t.h.o, Texas
Distribution: Slackware 13.x, rhel3/5, Solaris 8-10(sparc), HP-UX 11.x (pa-risc)
Posts: 987
Blog Entries: 4

Rep: Reputation: 252Reputation: 252Reputation: 252
Glad you got the 'code' tags figured-out.

Okay, here's what seems to be the layout.

1) You don't have 120GB, you have ~100GB
2) Partition "sda1" is about 242MB in size (probably /boot).
3) Partition "sda5" within "sda2" is 63.7GB, which shows up in the 'pvs' output as being used by Volume Group "atraina-alfdrp".
4) That means there's about 36.25GB somewhere that's not being used...between sectors 134215680 & 210247679 (near the end of the drive).

So now we know that you do have extra, unused (aka "unpartitioned") space on the drive...however, someone made a boo-boo - "Extended" partitions need to be extended before their logical partitions can be extended, then you'll have to resize the 'pv'.

Confused yet? I know I was the very first time I did this back in the 90's.

Basically, don't ever use an "Extended" (Type 5) partition untill you've used 3 Primary Partition types first (I'm sure there's an installer to blame or something...relax, we can work around this problem).

I want you to remember this for the rest of your life;
Retarded partitioning makes servers retarded. Retarded servers make admins retarded. Don't use "Extended" partitions. (They're retarded)



So here's what you should be able to do;

1) Create a 'Primary' partition on sda
Code:
fdisk /dev/sda
Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 3
First cylinder (1-210247679, default 134215680): 134215680
Last cylinder or +size or +sizeM or +sizeK (1-210247679, default 210247679): 210247679
2) Make your new "sda3" partition a "Physical Volume"
Code:
 /usr/sbin/pvcreate /dev/sda3
(Seriously, it was that easy)

3) Now add that new "Physical Volume" to your "Volume Group"
Code:
vgextend atraina-alfdrp /dev/sda3
4) Verify your "Volume Group" atraina-alfdrp has gobs of freespace via 'vgs'
Before
Code:
 VG            #PV #LV #SN  Attr   VSize   VFree
 atraina-alfdrp 1    2   0  wz--n- 63.76g  0
After
Code:
 VG            #PV #LV #SN  Attr   VSize   VFree
 atraina-alfdrp 1    2   0  wz--n- 63.76g  GOBS_OF_SPACE
5) Now extend the "Logical Volume" that is giving you space problems.
Code:
lvextend +1gb /dev/atraina-alfdrp/logical_volume_giving_you_problems
6) Done? Nope. Now you have to extend the "Filesystem" that lives all up inside that "Logicial Volume"
Google.

Quick Recap

Code:
Filesystem (<<< that thing you "df")
|
+--Logical Volume
    |
    +--Volume Group
        |
        +--Physical Volume
            |
            +--Partition
                |
                +--Hard Drive (or RAID, if your clever)

Now, because I have a sense of humor, I'm going to throw a big warning right at the end of my post;

Quote:
Please double-check all commands and read the man pages for anything you don't understand here. When in doubt, make sure you have backups handy (like, do your Tape-Recalls, like, now).
I am not responsible for your data, your server, or your job. However if my advice above does bomb-out your system and cause horrible gnashing of teeth, please come back and tell us (as I appreciate a good chuckle).

Last edited by xeleema; 03-15-2012 at 01:43 AM. Reason: There I go again, spewing caffeine-fueld rants on LQ in the middle of the night when I should be googling pr0n....
 
Old 03-15-2012, 02:16 AM   #7
stevenl
LQ Newbie
 
Registered: Mar 2012
Posts: 13

Original Poster
Rep: Reputation: Disabled
Thanks heaps for quick and prompt response.
Will try it out and let you know if any issue.

Cheers.
 
Old 03-15-2012, 08:12 AM   #8
stevenl
LQ Newbie
 
Registered: Mar 2012
Posts: 13

Original Poster
Rep: Reputation: Disabled
Code:
I tried running the commands as indicated in the post and it is failing when I try to save the partition.  See the behaviour below:

Command (m for help): n
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
p
Partition number (1-4, default 3):
Using default value 3
First sector (499712-210247679, default 499712):
Using default value 499712
Last sector, +sectors or +size{K,M,G} (499712-501757, default 501757):
Using default value 501757

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): 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 or after you run partprobe(8) or kpartx(8)
Syncing disks.
root@atraina-alfdrp:/#
 
Old 03-15-2012, 03:18 PM   #9
TKH
Member
 
Registered: Jul 2011
Location: Milky Way
Distribution: Ubuntu, LFS, Slackware, Fedora
Posts: 218

Rep: Reputation: 20
i think the best way is to use gparted, which has more features and more user-friendly
 
Old 03-15-2012, 04:08 PM   #10
xeleema
Member
 
Registered: Aug 2005
Location: D.i.t.h.o, Texas
Distribution: Slackware 13.x, rhel3/5, Solaris 8-10(sparc), HP-UX 11.x (pa-risc)
Posts: 987
Blog Entries: 4

Rep: Reputation: 252Reputation: 252Reputation: 252
Code:
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
Not a big problem. That's just re-reading the partition table. When you do an 'fdisk -l /dev/sda', you should still see sda3. If you don't, reboot and do another 'fdisk -l /dev/sda'.

Quote:
Originally Posted by TKH View Post
i think the best way is to use gparted, which has more features and more user-friendly
Not going to solve the "re-reading a partition table when the disk is in-use by the OS" problem.

Last edited by xeleema; 03-15-2012 at 04:09 PM.
 
2 members found this post helpful.
Old 03-16-2012, 05:10 AM   #11
TKH
Member
 
Registered: Jul 2011
Location: Milky Way
Distribution: Ubuntu, LFS, Slackware, Fedora
Posts: 218

Rep: Reputation: 20
Quote:
Originally Posted by xeleema View Post
Not going to solve the "re-reading a partition table when the disk is in-use by the OS" problem.
At least it helps dealing with partitions without typing
 
Old 03-16-2012, 05:48 AM   #12
xeleema
Member
 
Registered: Aug 2005
Location: D.i.t.h.o, Texas
Distribution: Slackware 13.x, rhel3/5, Solaris 8-10(sparc), HP-UX 11.x (pa-risc)
Posts: 987
Blog Entries: 4

Rep: Reputation: 252Reputation: 252Reputation: 252
Quote:
Originally Posted by TKH View Post
At least it helps dealing with partitions without typing
That it does! However, I'm a command-line junkie (/me looks at the ASCII art in my sig)
 
Old 03-18-2012, 01:14 AM   #13
TKH
Member
 
Registered: Jul 2011
Location: Milky Way
Distribution: Ubuntu, LFS, Slackware, Fedora
Posts: 218

Rep: Reputation: 20
Quote:
Originally Posted by xeleema View Post
That it does! However, I'm a command-line junkie (/me looks at the ASCII art in my sig)
I can see that
Well yeah, I hope these solve the poster's problem
 
Old 03-19-2012, 07:40 AM   #14
stevenl
LQ Newbie
 
Registered: Mar 2012
Posts: 13

Original Poster
Rep: Reputation: Disabled
Code:
Hi, still stuck.

root@atraina-alfdrp:/install# fdisk -l /dev/sda

Disk /dev/sda: 107.6 GB, 107646812160 bytes
255 heads, 63 sectors/track, 13087 cylinders, total 210247680 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: 0x000d854e

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      499711      248832   83  Linux
/dev/sda2          501758   134215679    66856961    5  Extended
/dev/sda3          499712      501757        1023   83  Linux
/dev/sda5          501760   134215679    66856960   8e  Linux LVM

Partition table entries are not in disk order

root@atraina-alfdrp:/# ./sbin/pvcreate /dev/sda3
  Device /dev/sda3 not found (or ignored by filtering).
root@atraina-alfdrp:/#


This is even after a reboot.
 
Old 03-19-2012, 08:29 AM   #15
xeleema
Member
 
Registered: Aug 2005
Location: D.i.t.h.o, Texas
Distribution: Slackware 13.x, rhel3/5, Solaris 8-10(sparc), HP-UX 11.x (pa-risc)
Posts: 987
Blog Entries: 4

Rep: Reputation: 252Reputation: 252Reputation: 252
Hm, your fdisk output doesn't quite look right. What's the output of this?
Code:
 fdisk -lu /dev/sda
This, too;
Code:
ls -l /dev/sda*
 
  


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
disk space unnecessarily full mbanwi Linux - Newbie 2 09-07-2009 10:52 AM
the disk space get full because of a log file. why???? another 1 Linux - Newbie 2 04-25-2009 12:42 PM
The hard disk space is full rahulruns Linux - General 5 04-14-2008 10:04 AM
disk space is full ( / is 100% in use) samengr Linux - General 3 01-26-2008 10:38 AM
Redhat 9 disk space full when not supose to be? cyb0rg51 Linux - Newbie 6 04-25-2004 01:25 AM


All times are GMT -5. The time now is 10:31 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration