Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
[off topic: it is very frustrating that I spend 15 - 20 minutes typing a detailed question only to be logged off when I submit it and have to retype the whole thing over again.]
Okay. I have a Linux box (kernel 2.4.18-8) running Squid proxy/cache version 2.4.STABLE7. The Linux box has a 40 GB hard drive. The hard drive's free space isn't allocated as I would like. Here's the current configuration:
The problem is my squid keeps on running out of space in the cache directory. Here's the logs from cache.log
Code:
2004/03/27 10:29:13| storeDirWriteCleanLogs: Starting...
2004/03/27 10:29:13| storeDirWriteCleanLogs: /var/spool/squid/swap.state.clean: write:
(28) No space left on device
2004/03/27 10:29:13| storeDirWriteCleanLogs: Current swap logfile not replaced.
FATAL: Received Segment Violation...dying.
2004/03/27 10:29:13| storeDirWriteCleanLogs: Starting...
2004/03/27 10:29:13| storeDirWriteCleanLogs: /var/spool/squid/swap.state.clean: write:
(28) No space left on device
2004/03/27 10:29:13| storeDirWriteCleanLogs: Current swap logfile not replaced.
[...]
2004/03/27 10:29:16| Set Current Directory to /var/spool/squid
FATAL: logfileWrite: /var/log/squid/store.log: (28) No space left on device
Squid Cache (Version 2.4.STABLE7): Terminated abnormally.
Here's the settings in squid.conf:
---- cache_dir diskd /var/spool/squid 150 16 256
I'm not sure what the numbers mean but I think 150 means that there's only 150 MB of space allocated for caching. I'd like to increase this by a LOT since my squid is crapping out nearly every day. But I only have 2 GB free on the / partition. And it seems like I have 33 Gigs sitting there gathering dust on the /home partition.
So my question is how do I go about moving at least 30 GB to somewhere that squid can access it in the /var/spool/squid directory? And if anyone is familiar with squid, what size should I increase the cache_dir numbers to, so squid stops running out of space?
You could do this without rearranging your partitions. Move /home back into the / partition, move squid to /dev/hda7 and make the squid directory the mount point for /dev/hda7.
Mount your two partitions. I am assuming that they use ext3 filesystems. Change the following mounts if they are not.
mkdir /part5
mkdir /part7
mount -t ext3 /dev/hda5 /part5
mount -t ext3 /dev/hda7/part7
Copy /home to / with:
cp -pR /part7/* /part5/home
Check to make sure that /part5/home has everything that it should and that the ownerships are OK by using the ls -l command.
ls -l /part7/*
ls -l /part5/home/*
Then delete he old /home files:
rm -R /part7/*
I am not familiar with the squid directory structure. From your post I assume that the squid directory that you want to be the mount point is /var/spool/squid. If it is something different then adjust thefollowing commands accordingly:
cp -pR /part5/var/spool/squid/* /part7
Check to make sure that /part7 has everything that it should and that the ownerships are OK by using the ls -l command.
ls -l /part7/*
ls -l /part5/var/spool/squid/*
Then delete the old squid files:
rm -R /part5/var/spool/squid/*
Now edit fstab:
vi /part5/etc/fstab
Change the fstab entry for /home to /var/spool/squid
Thans for your most excellent suggestion. I now understand what you mean. Bascially, copy the contents of the larger partition to the smaller one, and move the squid cache to the large 33G partition.
Although it makes sense, it's not precisely what I was hoping for. What I would prefer, is to be able somehow to make the / partition or main partition a little bigger too (maybe 8 Gigs, instead of just 3.4, since that's in theory where everything is) and make the squid cache around 25 Gigs or so. Is it possible?
If not, your suggestion will work for me too. Thanks again
" What I would prefer, is to be able somehow to make the / partition or main partition a little bigger too (maybe 8 Gigs, instead of just 3.4, since that's in theory where everything is) and make the squid cache around 25 Gigs or so. Is it possible?"
Yes. Partitions have to be contiguous. So the way to do it would be to delete partitions /dev/hda5 and /dev/hda7 and every partition between them, if any. This would leave you with a big empty space on your disk which you can then repartition with the new sizes that you want. You will lose everything in the partitions that you delete so you will have to back everything up before you delete any partitions. After you create the new partitions then you format the new partitions' file systems and restore your backups.
In order to figure out what you have to do you need a map of your partitions. To get a map log in as root and issue this command:
[root@localhost etc]# fdisk -l /dev/hda
Disk: /dev/hda: 255 heads, 63 sectors, 4865 cylinders
Units = cylinders of 16065 * 512 bytes
Device Boot Start End Blocks ID System
/dev/hda1 * 8 4866 39021916+ 5 Extended
/dev/hda4 1 7 56196 fe LANstep
/dev/hda5 8 453 3582463+ 83 Linux
/dev/hda6 454 484 248967 82 Linux swap
/dev/hda7 485 4866 35190382+ 83 Linux
Partition table entries are not in disk order
I have more partitions than I thought! But I see how the partitions are allocated. I believe my distro did this automatically when I installed it.
Is it possible to switch them? like put the / directory at /dev/hda7 and the /home directory at /dev/hda5 (rather than the squid cache directory)? Can I do this with the copy/paste method you described?
"Is it possible to switch them? like put the / directory at /dev/hda7 and the /home directory at /dev/hda5 (rather than the squid cache directory)? Can I do this with the copy/paste method you described?"
Yes. If you move / and/or /boot then you will have to also change your bootloader configuration and reinstall the bootloader.
Steps 1 and 2 are scrambled somewhat. You are going to end up with everything duplicated in /dev/hda5 and /dev/hda7. Actually, thinking about it, this is OK. Just be selective about what you erase.
You want everything to end up in /dev/hda7 including the /home directory. But the /home directory will be empty. You want the contents of /home to be in /dev/hda5. For example if you have two users named bonnie and clyde then you will end up with /bonnie and /clyde and their contents in /dev/part5.
"4. Change the bootloader configuration.
Could you give me more details on step 4, also let me know if I've missed anything? Then i think I'll be all set!"
Sorry for not getting back to you before, I was having a lot of trouble getting my CD-RW to work (I wanted to back up everything before I try this).
I have decided to move /home into the small partition along with /, and move the entire /var directory into the large partition. So I won't need to change my lilo.
Mount your two partitions. I am assuming that they use ext3 filesystems. Change the following mounts if they are not.
mkdir /part5
mkdir /part7
mount -t ext3 /dev/hda5 /part5
mount -t ext3 /dev/hda7/part7
Copy /home to / with:
cp -pR /part7/* /part5/home
Check to make sure that /part5/home has everything that it should and that the ownerships are OK by using the ls -l command.
ls -l /part7/*
ls -l /part5/home/*
Then delete he old /home files:
rm -R /part7/*
I am not familiar with the squid directory structure. From your post I assume that the squid directory that you want to be the mount point is /var/spool/squid. If it is something different then adjust thefollowing commands accordingly:
cp -pR /part5/var/spool/squid/* /part7
Check to make sure that /part7 has everything that it should and that the ownerships are OK by using the ls -l command.
ls -l /part7/*
ls -l /part5/var/spool/squid/*
Then delete the old squid files:
rm -R /part5/var/spool/squid/*
Now edit fstab:
vi /part5/etc/fstab
Change the fstab entry for /home to /var/spool/squid
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.