Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[HINT] large builds & low diskspace
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
pb
n00b
n00b


Joined: 08 Jan 2003
Posts: 6
Location: Kielce, Poland

PostPosted: Tue Dec 30, 2003 2:32 am    Post subject: [HINT] large builds & low diskspace Reply with quote

Here's a hint about doing large builds (openoffice, wine) when we have little space on each partition.
Let's say we have ~1G on each partition and we want to emerge openoffice (from sources). We can't use loop device to mount >2G filesystem image, because we can't create such a big file.
But we can create a few swap files, turn them on, resize /dev/shm and bind /dev/shm to /var/tmp portage.

First we will create some swap files (3x1G).
Code:

# dd if=/dev/zero of=/mnt/hda7/swap1 bs=1024k count=1024
# dd if=/dev/zero of=/mnt/hda8/swap2 bs=1024k count=1024
# dd if=/dev/zero of=/mnt/hda9/swap3 bs=1024k count=1024


Now we have to set them up...
Code:

# mkswap /mnt/hda7/swap1
# mkswap /mnt/hda8/swap2
# mkswap /mnt/hda9/swap3


...and turn them on.
Code:

# swapon -p 0 /mnt/hda7/swap1
# swapon -p 0 /mnt/hda8/swap2
# swapon -p 0 /mnt/hda9/swap3


Now we have additional 3G of swapspace. Because tmpfs can be swapped when it doesn't fit into memory, we can enlarge it. By deafault its size is half of available RAM.
Code:

# mount -o remount,size=2560m,nr_inodes=1m /dev/shm


Now we have 2.5G on /dev/shm. All we have to do is to bind it to /var/tmp/portage.
Code:

# mount -o bind /dev/shm /var/tmp/portage


Now we can do large builds without worrying about freespace ;).
I hope someone will find it useful ;).


Last edited by pb on Fri Jan 02, 2004 12:28 pm; edited 1 time in total
Back to top
View user's profile Send private message
NeighborhoodGullwings
Apprentice
Apprentice


Joined: 05 Dec 2003
Posts: 159

PostPosted: Tue Dec 30, 2003 3:54 am    Post subject: Reply with quote

Wow. That was a really creative solution. :) I'll have to remember that one.
Back to top
View user's profile Send private message
kalisphoenix
Apprentice
Apprentice


Joined: 28 Sep 2003
Posts: 211
Location: Ohio

PostPosted: Mon Mar 01, 2004 6:35 am    Post subject: Reply with quote

I had to read through that a couple times before I completely understood its genius...

Perhaps doing a similar thing (with NFS) will allow me to build @#$%ing XFree on this little laptop... heh... slowass build...

(Ah, what do I care? It's on about hour 20 of a kernel compile, if I'm not mistaken...)
Back to top
View user's profile Send private message
Boris27
Guru
Guru


Joined: 05 Nov 2003
Posts: 562
Location: Almelo, The Netherlands

PostPosted: Mon Mar 01, 2004 6:57 am    Post subject: Reply with quote

Are you really planning on using XFree86 on a 486 laptop?
Back to top
View user's profile Send private message
kalisphoenix
Apprentice
Apprentice


Joined: 28 Sep 2003
Posts: 211
Location: Ohio

PostPosted: Mon Mar 01, 2004 2:00 pm    Post subject: Reply with quote

Nah, I'm using KDrive on the 486. The Mac laptops have a bit more RAM but can't run KDrive, so I'll have to think something up for them...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum