Tux

...making Linux just a little more fun!

2-Cent Tip: Making space while installing

Ben Okopnik [ben at linuxgazette.net]


Tue, 30 Nov 2010 18:30:23 -0500

Date: Sun, 28 Nov 2010 11:22:04 +0100
From: Jacopo Sadoleto <jacopo.sadoleto@gmail.com>
To: TAG <tag@lists.linuxgazette.net>
To: ben at linuxgazette.net
Subject: 2-Cent Tip
Ben I would like to submit a tip, it it fails miserably off the mark, please feel free to bin-it...

Sometimes upgrading an Linux distro to a recent version, yields an "No space left on device" (usually /var); For those not willing to use a tool to create, resize, grow a partition, a simple artifice will do the trick:

CTRL-ALT-F2
# mv /var /home/user/? <== or wherever space suffice
# cd /
# ls -s /home/user/var .
CTRL-ALT-F7


Top    Back


Mulyadi Santosa [mulyadi.santosa at gmail.com]


Wed, 1 Dec 2010 13:24:02 +0700

Hi all

On Wed, Dec 1, 2010 at 06:30, Ben Okopnik <ben at linuxgazette.net> wrote:

> Date: Sun, 28 Nov 2010 11:22:04 +0100
> From: Jacopo Sadoleto <jacopo.sadoleto at gmail.com>
> To: ben at linuxgazette.net
> Subject: 2-Cent Tip
>
> Ben I would like to submit a tip, it it fails miserably off the mark, please
> feel free to bin-it...
>
> Sometimes upgrading an Linux distro to a recent version, yields an "No space
> left on device" (usually /var);
> For those not willing to use a tool to create, resize, grow a partition, a
> simple artifice will do the trick:
>
> CTRL-ALT-F2
> # mv /var /home/user/? <== or wherever space suffice
> # cd /
> # ls -s /home/user/var .

I believe he means "ln" instead of "ls". And I guess it would be: ln -s /home/user/var .

> CTRL-ALT-F7

-- regards,

Mulyadi Santosa Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com


Top    Back


Henry Grebler [henrygrebler at optusnet.com.au]


Wed, 01 Dec 2010 19:04:51 +1100

Hi,

>On Wed, Dec 1, 2010 at 06:30, Ben Okopnik <ben at linuxgazette.net> wrote:
>> Date: Sun, 28 Nov 2010 11:22:04 +0100
>> From: Jacopo Sadoleto <jacopo.sadoleto at gmail.com>
>> To: ben at linuxgazette.net
>> Subject: 2-Cent Tip
>>
>> Ben I would like to submit a tip, it it fails miserably off the mark, please
>> feel free to bin-it...
>>
>> Sometimes upgrading an Linux distro to a recent version, yields an "No space
>> left on device" (usually /var);
>> For those not willing to use a tool to create, resize, grow a partition, a
>> simple artifice will do the trick:
>>
>> CTRL-ALT-F2
>> # mv /var /home/user/??? <== or wherever space suffice
>> # cd /
>> # ls -s /home/user/var .
>I believe he means "ln" instead of "ls". And I guess it would be:
>ln -s /home/user/var .
>
>> CTRL-ALT-F7

In that case, we could reduce the tip to:

CTRL-ALT-F2
# mv /var /home/user		# <== or wherever space suffice
# ln -s /home/user/var /
CTRL-ALT-F7
Personally, I like to put it this way:
CTRL-ALT-F2
# DIR=/home/user		# <== or wherever space suffice
# mv /var $DIR
# ln -s $DIR/var /
CTRL-ALT-F7

The tip is simple (easy to understand and use), general (applies to a range of scenarios) and effective. The tricky bit is having the presence of mind to think of it when you are confronted with the problem. I usually think of such things in the context, "I should have used Jacopo's tip!"

Cheers, Henry


Top    Back


Ben Okopnik [ben at linuxgazette.net]


Wed, 1 Dec 2010 10:16:07 -0500

On Wed, Dec 01, 2010 at 01:24:02PM +0700, Mulyadi Santosa wrote:

> On Sun, 28 Nov 2010 Jacopo Sadoleto <jacopo.sadoleto@gmail.com> wrote:
> >
> > Sometimes upgrading an Linux distro to a recent version, yields an "No space
> > left on device" (usually /var);
> > For those not willing to use a tool to create, resize, grow a partition, a
> > simple artifice will do the trick:
> >
> > CTRL-ALT-F2
> > # mv /var /home/user/ <== or wherever space suffice
> > # cd /
> > # ls -s /home/user/var .
>
> I believe he means "ln" instead of "ls". And I guess it would be:
> ln -s /home/user/var .

That certainly makes sense. You could also skip the 'cd' and simply do 'ln -s /home/user/var /'.

Of course, the entire tip presumes that /home is already on a different partition. If you decided to use a single partition for everything when doing the original installation, then you've got a bit more of a job ahead of you.

-- 
* Ben Okopnik * Editor-in-Chief, Linux Gazette * http://LinuxGazette.NET *


Top    Back


Ben Okopnik [ben at linuxgazette.net]


Wed, 1 Dec 2010 10:22:39 -0500

On Wed, Dec 01, 2010 at 07:04:51PM +1100, Henry Grebler wrote:

> >On Sun, 28 Nov 2010, Jacopo Sadoleto <jacopo.sadoleto@gmail.com> wrote:
> >>
> >> CTRL-ALT-F2
> >> # mv /var /home/user/??? <== or wherever space suffice
> >> # cd /
> >> # ls -s /home/user/var .
> >I believe he means "ln" instead of "ls". And I guess it would be:
> >ln -s /home/user/var .
> >
> >> CTRL-ALT-F7
> 
> In that case, we could reduce the tip to:
> 
> CTRL-ALT-F2
> # mv /var /home/user		# <== or wherever space suffice
> # ln -s /home/user/var /
> CTRL-ALT-F7

[grin] I guess I should have read before posting; Henry's already covered this bit. Well, no harm.

> Personally, I like to put it this way:
> 
> CTRL-ALT-F2
> # DIR=/home/user		# <== or wherever space suffice
> # mv /var $DIR
> # ln -s $DIR/var /
> CTRL-ALT-F7

In that case, you could just use "$_" - Bash uses this variable to store the last explicitly-named directory.

# mv /var /home/user
# ln -s $_/var /
This is *nix. There's always more than one way to do it. :)

-- 
* Ben Okopnik * Editor-in-Chief, Linux Gazette * http://LinuxGazette.NET *


Top    Back


Ben Okopnik [ben at linuxgazette.net]


Wed, 1 Dec 2010 10:30:23 -0500

On Wed, Dec 01, 2010 at 10:22:39AM -0500, Benjamin Okopnik wrote:

> 
> In that case, you could just use "$_" - Bash uses this variable to store
> the last explicitly-named directory.

Erm, whoops. I was thinking of something else, actually. Bash sets "$_" to the value of the last argument, not the last directory. What I wrote will still work fine, though.

-- 
* Ben Okopnik * Editor-in-Chief, Linux Gazette * http://LinuxGazette.NET *


Top    Back