LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   VM thinks it's out of space (http://www.linuxquestions.org/questions/slackware-14/vm-thinks-its-out-of-space-4175439920/)

WhiteHotLoveTiger 12-04-2012 01:58 AM

VM thinks it's out of space
 
After using this guide, http://library.linode.com/linode-pla...m-distro-howto, I'm running Slackware 14 64bit on my linode (VPS). The basic process is to install your favourite distro on a local VM with a small harddrive, and then upload the entire VM to their servers. It's been running fine for the past few weeks, but just now as I was trying to add some photos to a web page I'm hosting, I starting running into some strange errors:
Code:

cp: writing '../my/photo.jpg': No space left on device
cp: failed to extend '../my/photo.jpg': No space left on device

The output from df seems to confirm that there's no room to copy my photo:
Code:

# df
Filesystem    1K-blocks    Used Available Use% Mounted on
/dev/xvda        3883200 3880244        0 100% /

But I know that there should be plenty of space left:
Code:

# fdisk -l

Disk /dev/xvda: 21.2 GB, 21206401024 bytes
255 heads, 63 sectors/track, 2578 cylinders, total 41418752 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

    Device Boot      Start        End      Blocks  Id  System

Disk /dev/xvdb: 268 MB, 268435456 bytes
255 heads, 63 sectors/track, 32 cylinders, total 524288 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

I think the 3883200 KB is about the size of the initial VM I set up on my local machine in order to install Slackware and set things up before I uploaded it to linode. I think that maybe Slackware doesn't realize it's got more space now? Does anyone have any advice about which settings or config file to look into further? Thanks.

jpollard 12-04-2012 09:06 AM

You have an unused disk (xvdb).

df will show the total/used/available amounts for all disks that are mounted.

xvdb is not mounted. To gain access to it, it needs to be initialized (partitioned/put filesystem on it), then mount it (I suggest using /mnt temporarily) then copy things to it that you want there. Rename the directory you copied from (for temporary safety), create a mountpoint with the same name. Dismount /mnt, and mount xvdb (or partition) on that mount point.

Make sure things still work... (as best you can with no disk space on root). Add a /etc/fstab entry for the new mount. verify it works... (dismount and just do a remount <your new mountpoint>), then, and only then remove the renamed directory.

Your root filesystem will now have free space.

WhiteHotLoveTiger 12-04-2012 10:01 AM

xvdb is just my swap space. It's only 268 MB, whereas xvda is mounted and is supposed to be 21.2 GB.

WhiteHotLoveTiger 12-04-2012 10:56 AM

I've got it solved now. It turns out that I just needed to run 'resize2fs'.

Code:

# df
Filesystem    1K-blocks    Used Available Use% Mounted on
/dev/xvda        3883200 3126648    559292  85% /

# resize2fs /dev/xvda
resize2fs 1.42.6 (21-Sep-2012)
Filesystem at /dev/xvda is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 2
The filesystem on /dev/xvda is now 5177344 blocks long.

# df
Filesystem    1K-blocks    Used Available Use% Mounted on
/dev/xvda      20393244 3129484  16400672  17% /



All times are GMT -5. The time now is 10:44 AM.