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-11-2006, 06:13 PM   #1
markw8500
Member
 
Registered: Jul 2005
Posts: 104

Rep: Reputation: 15
Change the size of a directory...


Does anybody know how to change the size of a directory? I have a directory that has 0 bytes of space and I cant do anything with it...
 
Old 01-11-2006, 06:24 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
It's not the directory that is out of space, but the partition it's mounted on - since I'm ignoring possible quota problems, can you post the error message that you get when you try to write to the directory?

Running the following will list the space usage of each of your partitions:

Code:
df -h
Unless you have unpartitioned space, your choices are pretty much to (1) delete files or (2) resize partitions to re-distribute the available space. Deleting unncesseary files is much easier

If you want to know the used space in a directory hierarchy (for example /usr/local/tmp), try something like:

Code:
du -sh /usr/local/tmp 2>/dev/null
If you want to find all your large files (for example, bigger than 500MB) user something like:

Code:
find / -size +500M -exec ls -l {} \; 2>/dev/null
 
Old 01-11-2006, 06:39 PM   #3
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
I really think it is a bad idea to install a Linux in multiple partitions. Why can people put all the /boot, /usr, /root,/dev etc in one big root directory and forget about all these size problems, booting to root or /boot and stuck with one Linux for rest of their life.
 
Old 01-11-2006, 07:13 PM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
do we know that size of 0 doesn't just mean there's nothing in the directory?

More precisely, note that--in a typical linux setup, the size of the directory is constant at 4096 bytes--the content is the inode table pointing to the files assigned to that directory. so where does one get info that the size is 0? The only way I can get a 0 is as a measure of the **content**--ie the number of files in the directory. In ls -l, it simply says the size is 4096
 
Old 01-11-2006, 07:35 PM   #5
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
Quote:
Originally Posted by saikee
I really think it is a bad idea to install a Linux in multiple partitions. Why can people put all the /boot, /usr, /root,/dev etc in one big root directory and forget about all these size problems, booting to root or /boot and stuck with one Linux for rest of their life.
It really depends on what you're using the box for - plain old desktop use with one user and steady changes in disk usage may work fine with one big partition.

If you're running larger systems though it's useful to partition things off. I like my Oracle running on separate disks, indexes in one place, data in another - it helps the performance. I also like mail spools in their own location (under /var) so that if something silly happens with volumes of mail it doesn't choke my whole system. Having /tmp in its own location and restricting exes reduces the risk of bad things being run from there. Having /home on its own partition saves me time restoring data after a re-image.

I'm sure there are plenty of folks here with better reasons than these to split up your system across partitions and disks...
 
Old 01-11-2006, 09:19 PM   #6
tkedwards
Senior Member
 
Registered: Aug 2004
Location: Munich, Germany
Distribution: Opensuse 11.2
Posts: 1,549

Rep: Reputation: 52
Quote:
I really think it is a bad idea to install a Linux in multiple partitions. Why can people put all the /boot, /usr, /root,/dev etc in one big root directory and forget about all these size problems, booting to root or /boot and stuck with one Linux for rest of their life.
For home systems I agree completely, there's no reason at all in most cases to micro-partition every system directory. However you should keep /home on a seperate partition always.

For servers at work I find its good to have /boot on a seperate partition (its necessary when using LVM) and its often necessary to move things like /var/log off to another partition, wether by itself or onto a bigger data partition such as the one used for /home. And of course for Oracle its very useful to have seperate partitions for the different Oracle directories.

Last edited by tkedwards; 01-11-2006 at 09:20 PM.
 
Old 01-12-2006, 04:45 PM   #7
markw8500
Member
 
Registered: Jul 2005
Posts: 104

Original Poster
Rep: Reputation: 15
Quote:
Unless you have unpartitioned space, your choices are pretty much to (1) delete files or (2) resize partitions to re-distribute the available space. Deleting unncesseary files is much easier
That is the thing, I cant delete the directory. When I try, it does nothing. When I try to write to it I get "Error while copying to IVS. There is not enough space on the destination."

And to use one of my programs I have to write to it...



Also if I try to mount the IVS dir I get this error:

mount: wrong fs type, bad option, bad superblock on automount(pid2188),
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or so


How do I repartition the space to enlarge the directory?

Last edited by markw8500; 01-12-2006 at 04:57 PM.
 
Old 01-12-2006, 04:57 PM   #8
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
What did the df & du commands above say when you ran them? If it is a full partition (directories can't be resized, partitions can), you need to know whether there is free space elsewhere on the drive.
 
Old 01-12-2006, 05:26 PM   #9
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
Quote:
Originally Posted by saikee
I really think it is a bad idea to install a Linux in multiple partitions.
I disagree, but have no problem with one large partition if that's what someone wants and understands the pluses/minuses.

For backups, I like multiple partitions. I'm talking dd's and dumps - things that work at that level. tar's and rsync's don't really care.

For ease of upgrades, I like multiple partitions. As someone already said, at least keep /home seperate. /usr/local too, IMHO.

For specific applications, even on a home system, I like multiple partitions. e.g., MythTV. I don't want to be in the middle of recording a TV show and have the entire system go unstable because disk space ran out for everybody (including the OS). Much better to simply run yourself out of space over on some seperate "video" partition.

You may also want different partitions so you can have different filesystem types. Back to the MythTV example, your video directory will be happier using XFS or JFS, but you may prefer Reiser for your other stuff.

On the downside for multiple partitions:

If you decide to use multiple partitions and don't set them up wisely, you could end up with a bunch of work to fix allocations later. It could be said that "setting them up wisely" is a goal that is rarely achieved. Over time it seems you always realise you messed up initially. This is where LVM comes to the rescue. I also use (and highly recommend) that.
 
Old 01-12-2006, 06:05 PM   #10
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
Just like Windows I never mix a system files with my personal data. In that arrangement one can mount as many partitions to do whatever one fancies on various tasks.

If one insists on mixing the personal or user data with an operating system then more partitions would be merrier.

The multi partitions have created more trouble than their worth to a lot of newcomers who usually have one or a couple of large hard disks.

I can see intensive work on a server can be benefited by running an army of disks like a RAID system to shorten the response time of data transfer. There are always courses for horses.

My comment is directed to users who make multiple partitions but have no idea how best to use them and so the scheme becomes a liability.

There are a lot of booting troubles associated with multiple partitions when a user doesn't know to find a Linux's root from /boot, /root, / and LVM.

Things do change. When we can install Linux at partition hda60 and booted at the end of a 300Gb disk the idea of have a /boot at below 1024 cylinders is becoming less relevant.
 
Old 01-12-2006, 06:24 PM   #11
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
Quote:
Originally Posted by markw8500
Also if I try to mount the IVS dir I get this error:

mount: wrong fs type, bad option, bad superblock on automount(pid2188),
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or so


How do I repartition the space to enlarge the directory?
Ah, that may be the problem. Can you please post the contents of your /etc/fstab file (or at least the line relating to the IVS directory as well as the command you use to mount it manually (and the full output if there's more than what is above)?
 
Old 01-13-2006, 05:17 PM   #12
markw8500
Member
 
Registered: Jul 2005
Posts: 104

Original Poster
Rep: Reputation: 15
I figured it out... or at least how to stop it... Some how that directory became an automount directory. So I just killed the PID and deleted the dir...

I do appreciate all of your ideas and opinions on disk partitions. I got some neat ideas...


Thanks,

Mark
 
  


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
How to know the size of a directory? kornerr Linux - General 4 06-30-2005 09:59 AM
Which directory contains files that normally change their size frequently? Simon Adebisi Linux - Software 4 06-28-2005 03:37 PM
mountig - change ro to rw, delete directory, change rw to ro ?? itsjustme Linux - General 6 10-17-2003 11:48 AM
directory size chandan Linux - General 3 06-26-2003 08:51 AM
directory size adenardo Linux - General 1 10-23-2001 01:34 PM

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

All times are GMT -5. The time now is 02:15 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