Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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.
[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
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
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?
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?
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.