LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-17-2005, 11:13 PM   #1
jlassiter
LQ Newbie
 
Registered: Sep 2004
Location: Landrum, SC
Distribution: Debian
Posts: 17

Rep: Reputation: 0
"Hard drive full". Really ? What next?


I am getting error messages to the effect that there's not enough space on the drive.

How can I verify that this is true ?

If it is true, can I use cfdisk to resize the partition ?


Maybe some of the following info will be informative.

Here is an example error message, received while doing apt-get upgrade

Preparing to replace msttcorefonts 1.1.12 (using .../msttcorefonts_1.2_all.deb) ...
Unpacking replacement msttcorefonts ...
Preparing to replace mysql-server 4.0.22-6 (using .../mysql-server_4.0.23-1_i386.deb) ...
ERROR: There's not enough space in /var/lib/mysql/
dpkg: error processing /var/cache/apt/archives/mysql-server_4.0.23-1_i386.deb (--unpack):
subprocess pre-installation script returned error exit status 1
Preparing to replace python2.3-numeric 23.6-2 (using .../python2.3-numeric_23.6-3_i386.deb) ...
Unpacking replacement python2.3-numeric ...
Errors were encountered while processing:
/var/cache/apt/archives/mysql-server_4.0.23-1_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)



Welcome to Knoppix (Kernel 2.6.7)

root@linuxbox:/home/john# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hda1 6040288 5817536 0 100% /

root@linuxbox:/home/john# parted
Using /dev/hda
Information: The operating system thinks the geometry on /dev/hda is
19457/255/63. Therefore, cylinder 1024 ends at 8032.499M.
(parted)


root@linuxbox:/home/john# nano /etc/fstab
# filesystem mountpoint type options dump pass
/dev/hda1 / ext3 defaults,errors=remount-ro 0 1
/dev/hda5 none swap defaults 0 0
/dev/hda6 /mnt/hda6 ext3 noauto,users,exec 0 2
proc /proc proc defaults 0 0
/dev/fd0 /floppy vfat defaults,user,noauto,showexec,umask=022 0 0
usbdevfs /proc/bus/usb usbdevfs defaults 0 0
sysfs /sys sysfs defaults 0 0
/dev/cdrom /cdrom iso9660 defaults,ro,user,noexec,noauto 0 0
/dev/cdaudio /cdaudio iso9660 defaults,ro,user,noexec,noauto 0 0
/dev/dvd /dvd iso9660 defaults,ro,user,noexec,noauto 0 0
# Added by KNOPPIX
/dev/hda3 /mnt/hda3 ext2 noauto,users,exec 0 0

root@linuxbox:/home/john# cfdisk
cfdisk 2.11u

Disk Drive: /dev/hda
Size: 160041885696 bytes, 160.0 GB
Heads: 255 Sectors per Track: 63 Cylinders: 19457

Name Flags Part Type FS Type [Label] Size (MB)
----------------------------------------------------------------------------------------------------------------------------
hda1 Boot Primary Linux ext3 6284.12
hda5 Logical Linux swap 518.20
hda6 Logical Linux ext3 8562.52
hda3 Primary Linux ext2 144674.45
 
Old 01-18-2005, 12:27 AM   #2
Zuggy
Member
 
Registered: Mar 2004
Location: Pocatello, Idaho, USA
Distribution: Ubuntu
Posts: 256

Rep: Reputation: 30
To verify how much space is on the Hard Drive use the following command:

Code:
df -m
You may need to be root to run the command, I can't remember. What it'll do is show you how much Disk space (in megabytes) is being used, how much is free and what percentage is in use.
 
Old 01-18-2005, 07:45 AM   #3
jlassiter
LQ Newbie
 
Registered: Sep 2004
Location: Landrum, SC
Distribution: Debian
Posts: 17

Original Poster
Rep: Reputation: 0
Thanks for your reply.

john@linuxbox:~$ df -m
Filesystem 1M-blocks Used Available Use% Mounted on
/dev/hda1 5899 5707 0 100%


Well, according to df the partition really is full.

I tried to run fsck but it scared me by saying that really bad things could happen by running fsck on a mounted drive.
 
Old 01-18-2005, 08:08 AM   #4
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Quote:
Originally posted by jlassiter
Thanks for your reply.

john@linuxbox:~$ df -m
Filesystem 1M-blocks Used Available Use% Mounted on
/dev/hda1 5899 5707 0 100%


Well, according to df the partition really is full.

I tried to run fsck but it scared me by saying that really bad things could happen by running fsck on a mounted drive.
cfdisk is not a tool to resize partitions with data on them. You'll have to use something like gnuparted.. http://freshmeat.net/projects/gnuparted/

But I think currently it only supports ext2, which I'm guessing at most Knoppix uses ext3 or some other journaling filesystem.

I'm guessing that hda1 is your root partition?

Last edited by trickykid; 01-18-2005 at 08:09 AM.
 
Old 01-18-2005, 08:59 AM   #5
bdrake
Member
 
Registered: Aug 2004
Location: Montrose, CA
Distribution: Slackware, SuSE, OpenZaurus
Posts: 45

Rep: Reputation: 16
Yep, it's full. It looks like your partitioning scheme got screwed up somewhere along the line. 6GB isn't that big for a complete file system. Looking at your cfdisk results, you have /dev/hda6 at 8GB and /dev/hda3 at a whopping 144GB, so you have plenty of space on the drive as a whole. However, looking at your fstab, it seems that these two partitions aren't mounted anywhere useful (/mnt/hda3 and /mnt/hda6???).

What we seem to have now is:
/dev/hda1 / 6GB
/dev/hda3 /mnt/hda3 144GB
/dev/hda6 /mnt/hda6 8GB

What we probably want is:
/dev/hda1 /boot 6GB
/dev/hda3 /var 144GB
/dev/hda6 / 8GB
(/boot really doesn't need to be that big, but it does need to be at the beginning of the disk.)

To accomplish this, you're going to need to move some stuff around or just reinstall the OS. How "old" is this installation? If it's brand new, I would start over so that you can use a better partitioning scheme, such as:
/dev/hda1 /boot 100MB
/dev/hda5 swap 500MB
/dev/hda3 / 10GB
/dev/hda6 /var 50GB
/dev/hda7 /home 99GB

These last two numbers are highly debatable, depending on the uses to which your machine will be put. In other words, where will you be requiring the most space? If you need lots of stuff in user home directories, then /home should be large. If your machine is only going to be a webserver, but is serving lots of files, then /var should be large and /home can be small. So, what is the server for?

--Barry
 
Old 01-18-2005, 03:04 PM   #6
Korff
Member
 
Registered: May 2003
Location: Central Florida
Distribution: Gentoo
Posts: 103

Rep: Reputation: 15
Why split it?
All you need is / and swap, or at the very most, /boot / and swap. Maybe I'm behind the times, but limiting space per partition seems dumb to me. /shrug.

If you do make a /boot partition, make it 100mb or so, and make sure it is your first partition.
 
Old 01-18-2005, 03:32 PM   #7
Blinker_Fluid
Member
 
Registered: Jul 2003
Location: Clinging to my guns and religion.
Posts: 683

Rep: Reputation: 63
Figure out what's using your space...
find . -size +1000 -exec ls -l {} \; | sort -k 5n
I split mine so that if something gets out of control it doesn't fill up the whole disk.
 
Old 01-18-2005, 11:08 PM   #8
jlassiter
LQ Newbie
 
Registered: Sep 2004
Location: Landrum, SC
Distribution: Debian
Posts: 17

Original Poster
Rep: Reputation: 0
Deleted about one gigabyte of music AND ran apt-get clean. That got me down to 68% usage on hda1.

This machine is being used as a webserver. ( http://jdl.homedns.org )

I am the only user on it.

When I set it up it had a 15 gig HD. I picked up a 160GB at BestBuy on Black Friday
for $30 after rebates. Just copied the 15GB drive to the new one.

There isn't much on this installation yet, so I may just reinstall and choose a more reasonable partition scheme.

My thanks to all of you. Very helpful.
 
Old 01-18-2005, 11:36 PM   #9
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
Korff,
There are a lot of good reasons to split up the filesystem.

For instance, you can put /var on its own partition. The reason for that is, if your var partition fills up with logs, your system won't grind to a halt. Logging utilities will fail because they can't write, but the system itself will still be functional to clear out old/unnecessary logs or run-time data. You gain a similar benefit if you do the same thing with /tmp (in case some process goes ballistic creating temporary files).

You could create a partition for /etc. Doing that would allow you to mount it read-only. That way, only users allowed to mount drives can make changes to settings (by mounting it read-write, make changes, re-mount read-only). It also prevents any script or "make install" commands from blindly making changes to your configuration. That way, you see the error in the script, and can inspect the changes the software wants to make before deciding if it's something you want to allow.

Similarly, if you have your core utilities (/bin, /lib, /sbin) on a separate partition and read-only, you gain the benefit of making sure nobody can come in and mess with the system's basic functionality. That gives you a little added security that if something horrible goes wrong, you can boot into single-user mode to recover (except in the worst situations; like dd if=/dev/zero of=/dev/hda).

Also, /home is useful as a separate partition for the purposes of preservation. You could wipe out your entire installation on every other partition, re-install a brand new distribution, and you would maintain your personal settings and files without having to tar-backup-untar.

I'm sure there are others, but those are the ones that came to me off the top of my head.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
"hdc: lost interrupt" - hard drive hangs philetus Linux - Hardware 18 03-14-2008 05:17 AM
Onkyo MB-S1 "Digital Music Libary" CD Player (Hard Drive Format?) bpk Linux - Hardware 3 08-12-2006 12:33 AM
mandriva 10.1 install stops at "hard drive detection" Devoid_Janitor Mandriva 0 08-08-2005 11:30 AM
Mandrake 10.1 - Linux doesn't "see" free hard drive space scottlyter Linux - General 3 10-15-2004 04:39 PM
"GRUB error 15" after hard drive removal maxfacta Linux - General 2 08-31-2004 08:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration