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

As a professional system administrator you surely have backups and a tested procedure for recovering data from them.
–
IainJun 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
–
CarlosJun 13 '13 at 16:57

3 Answers
3

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.

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
–
CarlosJun 13 '13 at 17:05

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.

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
–
CarlosJun 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.
–
DKNUCKLESJun 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
–
CarlosJun 13 '13 at 17:00