Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have an issue with dpkg and disk space. When I installed my pc, I let the installer create partitions using lvm. My rootfs was created at 322MB, now I just have 97M left. The disk is full so there is no room to expand the partition.

When trying to use dpkg to install gvsig, dpkg says it is not possible to write on disk because there is not enough space and gives a broken pipe. I could resize my partition, but then I could lose my information.

Please give me a suggestion to install this package without losing information having to reinstall my system

My LVM partitions are:

S.ficheros                 Tamaño Usados  Disp Uso% Montado en
rootfs                       322M   209M   97M  69% /
udev                          10M      0   10M   0% /dev
tmpfs                        393M   672K  392M   1% /run
/dev/mapper/lordnikol-root   322M   209M   97M  69% /
tmpfs                        5,0M      0  5,0M   0% /run/lock
tmpfs                        785M   3,7M  781M   1% /run/shm
/dev/sda1                    228M    30M  186M  14% /boot
/dev/mapper/lordnikol-home   276G    22G  240G   9% /home
/dev/mapper/lordnikol-tmp    368M    11M  339M   3% /tmp
/dev/mapper/lordnikol-usr    8,3G   5,1G  2,8G  65% /usr
/dev/mapper/lordnikol-var    2,8G   881M  1,8G  33% /var

Thanks a lot

share|improve this question
    
As a professional system administrator you surely have backups and a tested procedure for recovering data from them. –  Iain Jun 13 '13 at 16:50
    
Sure, however, it is my pc, and I was testing LVM, for been honest it is the first time that I let debian installer decide for me the partitions, just for taste and learn LVM –  Carlos Jun 13 '13 at 16:57
add comment

3 Answers

up vote 2 down vote accepted

Where did the rest of your space go? Was it allocated to another LV or left unallocated?

Solving this problem with a quick fix like clearing logs or temporary caches will likely buy you enough room to install the dpkg however you're almost assuredly going to run into the issue again in the not so distant future. Solving it on a more permanent basis without rearranging your partition layout with a reinstall could be done in one of two ways:

1) If you have free space on your volume group, you can simply expand your current logical volume:

To determine which volume group your active partition is in, first find the LV and VG corresponding to your root partition. Search for it in /etc/fstab -- it will be something like /dev/vg00/lv01. Once you determine the LV and VG, use vgs to see if the corresponding VG has free space (seen under VFree). If so, you can simply add more space to the LV: lvresize +XXGB /dev/vg00/lv01 (replace XX with the number of GB to expand, and the device path name with you own). Once that is complete, assuming you are using ext3 or ext4, you can online expand the filesystem: resize2fs /dev/vg00/lv01 and you're done!

2) Add another drive to your system, partition it as an LVM device (fdisk /dev/XXX), create an LVM PV on it (pvcreate /dev/XXX), add it to the VG (vgextend /dev/vg00/lv01 /dev/XXX, and then expand the LV as above.

share|improve this answer
    
I am not completely sure if it works, I will try, however, I was looking this kind of information that was hard to find on google, anyway, you help me a lot and give a light and route for go a head. Thanks a lot –  Carlos Jun 13 '13 at 17:05
add comment

The beauty of LVM is that you can re-size the volumes as needed. You just have to worry about the underlying file system.

If one of your volumes has free space, shrink the file system then shrink that volume. You can then extend your root volume and then expand the file system.

share|improve this answer
add comment

You should be able to use GParted to resize your partition. I have done this several times with various machines and haven't lost any information - this is assuming, however, that you have space available on the physical / virtual hard drive.

Download the live CD, boot from that and then resize accordingly.

share|improve this answer
    
My problem is that my whole hd is partitioned, the I must make one partition smaller in order to grow up my rootsf partition, and google tell me I could lost my data –  Carlos Jun 13 '13 at 16:45
    
I've amended your question to put that information. If it was me I would image the machine, replace the hard drive with a larger drive, restore the image and expand the partition when that was done. –  DKNUCKLES Jun 13 '13 at 16:52
    
I have added my partitions info, as a LVM learner, I am trying to find a solution without lost info, or baackup and restore data, or something else, but first at all, without lost data, unfortunately, I have not found so much info on google –  Carlos Jun 13 '13 at 17:00
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.