Missing Disk Space
Hi,
I've just installed CentOS 5.4 on a 8GB solid state disk. I took all the default steps through installation. Everything works fine, but I appear to have lost about half the disk space. I believe the filesystem takes away about 5% of the diskspace Here's what's led me to believe this: ________________________________________________________________________ [root@localhost ~]# fdisk /dev/sda Command (m for help): p Disk /dev/sda: 8220 MB, 8220835840 bytes 255 heads, 63 sectors/track, 999 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 * 1 13 104391 83 Linux /dev/sda2 14 999 7920045 8e Linux LVM Command (m for help): _________________________________________________________________________ _________________________________________________________________________ [root@localhost ~]# df Filesystem 1K-blocks Used Available Use% Mounted on /dev/mapper/VolGroup00-LogVol00 3872392 2738140 934368 75% / /dev/sda1 101086 12587 83280 14% /boot tmpfs 8218288 0 8218288 0% /dev/shm _________________________________________________________________________ fdisk reports there are 8220835840 bytes df reports there are 3872392 + 101086 KB which more or less works out as (3973478000/8220835840)*100 = 48% Is tmpfs set up incorrectly? Am I using linux LVM incorrectly? Or have I just interpreted all this information incorrectly? Any clues as to why I'm losing this space would be most welcome. Thanks, |
What do /usr/sbin/vgdisplay and /usr/sbin/pvdisplay return?
|
thanks for the fast reply, here are the results
[root@localhost /]# vgdisplay --- Volume group --- VG Name VolGroup00 System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 3 VG Access read/write VG Status resizable MAX LV 0 Cur LV 2 Open LV 2 Max PV 0 Cur PV 1 Act PV 1 VG Size 7.53 GB PE Size 32.00 MB Total PE 241 Alloc PE / Size 241 / 7.53 GB Free PE / Size 0 / 0 VG UUID RwoRbb-fCI6-n1VV-8eRl-o5Gj-RpRt-OuyQex [root@localhost /]# pvdisplay --- Physical volume --- PV Name /dev/sda2 VG Name VolGroup00 PV Size 7.55 GB / not usable 22.42 MB Allocatable yes (but full) PE Size (KByte) 32768 Total PE 241 Free PE 0 Allocated PE 241 PV UUID 5hTqVl-LxWE-CyOc-ziX2-zjcn-NNgi-e248Qw |
And 'df -h'?
You might try booting from CD, importing the volume group, and fscking the logical volume. |
[root@localhost /]# df -h
Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup00-LogVol00 3.7G 2.7G 913M 75% / /dev/sda1 99M 13M 82M 14% /boot tmpfs 7.9G 0 7.9G 0% /dev/shm Do you have a link about how to do what you've described? Does it look like I've set something up incorrectly? many thanks, |
The output of the command lvdisplay would also help.
The default installation creates 2 partitions, one for /boot and 2 the LVM which contains / and swap. It appears that the LV for / is only 3.7G from the ouput of df. The output of lvdisplay will show us the actual size. |
[root@localhost /]# lvdisplay
--- Logical volume --- LV Name /dev/VolGroup00/LogVol00 VG Name VolGroup00 LV UUID ifgYuc-89Im-22aP-bwih-Rxr2-A0Nf-I0TXZd LV Write Access read/write LV Status available # open 1 LV Size 3.81 GB Current LE 122 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:0 --- Logical volume --- LV Name /dev/VolGroup00/LogVol01 VG Name VolGroup00 LV UUID xYeOFD-gMS7-jcAW-0rWm-A5k0-NzLz-WMruYu LV Write Access read/write LV Status available # open 1 LV Size 3.72 GB Current LE 119 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:1 Thanks again for looking into this. |
So from what I understand of this output: I've got two logical volumes, which both belong to the same Volume group. but only one of them is acessable. Is there anyway to fix this? Should this have happened with a default installation?
|
Post the output of the /etc/fstab file. Is the second logical volume your swap partition?
|
[root@localhost etc]# cat /etc/fstab
/dev/VolGroup00/LogVol00 / ext3 defaults 1 1 LABEL=/boot /boot ext3 defaults 1 2 tmpfs /dev/shm tmpfs defaults 0 0 devpts /dev/pts devpts gid=5,mode=620 0 0 sysfs /sys sysfs defaults 0 0 proc /proc proc defaults 0 0 /dev/VolGroup00/LogVol01 swap swap defaults 0 0 oh! Does that mean I've got a 3.7GB swap drive? I'm guessing I don't need it anywhere near as big as that. Is there anyway to move some space from LogVol01 over to LogVol00? Thanks again with your help so far! |
Yes and yes, search the centos/redhat docs for how to resize a logical volume and then your root partition (I believe it's called resize2fs on RHEL5). It's safe, but always have a backup in case of electrical (or user ;)) error
|
There are some reasons other than disk space consumption why you might not want to use any space on a solid-state drive for swap. The short story is that solid state drives, like all flash memory, have limited write cycle endurance. Reading data does no harm, so you can read the data any number of times without affecting device life. But every time you write a flash memory cell, there is a small probability that you will actually damage that memory. And the probability of damage increases with the number of writes. If you hit the swap heavily, you will likely shorten the life of the part of the solid state drive used for swap. Errors in the swap can wreak havock with system stability.
On systems where I do have swap, I often find that the swap is never used anyway. You can examine swap file usage from a console terminal with the command cat /proc/swaps By contrast, writing to magnetic disks does not impact the life of the media. I run my netbook with no swap. Sometimes I run out of memory and the machine crashes, but it comes back with reset with no real harm. If you run programs that swap heavily on a machine with solid state drive, you may want to consider setting up an external USB hard drive (really a disk drive, not a flash drive) for swap space. Then use the external swap drive space for your heavy-swapping applications. |
Thanks to everyone that posted help on this thread.
Here's what I did to remove the swap logical partition and regain the space in another. (as root, OS booted as normal) swapoff -a lvremove /dev/VolGroup00/LogVol01 lvextend -L +3.7G /dev/VolGroup00/LogVol00 resize2fs /dev/VolGroup00/LogVol00 |
All times are GMT -5. The time now is 09:32 AM. |