LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 06-03-2011, 10:14 AM   #1
richardhufford
LQ Newbie
 
Registered: May 2006
Location: Safford, AZ, USA
Distribution: Ubuntu 11.04
Posts: 15
Blog Entries: 1

Rep: Reputation: 0
howto free space? (Ubuntu)


I've been using my Ubuntu Linux (11.4?) computer to recover files from a hard drive. At this point, I've recovered so many files that I have no available space on the hard drive, and Ubuntu won't boot normally. I can boot in recovery mode, so I'm deleting files from the root terminal, using the rm -r command. I then type df to see how much space I've freed, and I notice that the Used blocks number goes down, but the Available blocks number is still zero. How do I make these blocks available?
 
Old 06-03-2011, 10:45 AM   #2
16pide
Member
 
Registered: Jan 2010
Posts: 418

Rep: Reputation: 83
My magic command to find things I may want to remove is:
Code:
du -xak /|sort -n|tail -50
Then you'll know what is using up most space.
 
Old 06-03-2011, 10:54 AM   #3
richardhufford
LQ Newbie
 
Registered: May 2006
Location: Safford, AZ, USA
Distribution: Ubuntu 11.04
Posts: 15
Blog Entries: 1

Original Poster
Rep: Reputation: 0
I'll have give that command a try! This time, though, I know which files are taking up all the space. My problem is that I've deleted thousands of files, and I still have no free space.
 
Old 06-03-2011, 11:02 AM   #4
16pide
Member
 
Registered: Jan 2010
Posts: 418

Rep: Reputation: 83
can you post here the output of that du command above, (replace / with your filesystem mount point) and also the output of df
 
Old 06-03-2011, 11:43 AM   #5
bryanl
Member
 
Registered: Dec 2003
Posts: 96

Rep: Reputation: 35
take a look at tune2fs. 'sudo tune2fs -l /dev/sda1' will provide a report about the usage of dev/sda1

you may be into the reserved blocks, which exist so a normal user will always leave room for system operations. On storage only drives, you can often set this to 0 (e.g. 'tune2fs -m0 /dev/sda1')
 
Old 06-03-2011, 11:48 AM   #6
richardhufford
LQ Newbie
 
Registered: May 2006
Location: Safford, AZ, USA
Distribution: Ubuntu 11.04
Posts: 15
Blog Entries: 1

Original Poster
Rep: Reputation: 0
I'm typing this on another computer, so I can only summarize the results. I'll start with the df command. For filesystem /dev/sda1, I have 19150120 blocks, 18229792 used and 0 available. 100% use, mounted on /
There are four other filesystems named "none". These filesystems all have less than 1000 blocks used and about 250000 available. (Note, I have a thumbdrive and a camera plugged into USB ports. I also have the drive I am trying to recover files from. I probably should have removed them.)
The results of the du command mostly scrolled off the screen. One of the lines that didn't scroll off shows a directory containing recovered files:
612908 /home/richard/Desktop/photorec_files/recup_dir.210
I deleted recup_dir.1 through recup_dir.161 using commands such as rm -r recup_dir.1? .
Here are some more lines:
918040 /usr/lib
984536 /usr/share
2189216 /usr
14240652 /home/richard/Desktop/photoreec_files
14419452 /home/richard/Desktop
15111760 /home/richard
15111764 /home
18053664 /

One of the options from the recovery menu is to run fsck. Should I give that a try?
 
Old 06-03-2011, 12:38 PM   #7
bryanl
Member
 
Registered: Dec 2003
Posts: 96

Rep: Reputation: 35
re: "There are four other filesystems named "none". These filesystems all have less than 1000 blocks used and about 250000 available." -- these are usually RAM disks for (mostly) system cache type use. (compare to RAM size in your machine and swap file size)

re: "The results of the du command mostly scrolled off the screen." -- either output to a file (e.g. du * > du-results) or simplify output (e.g. du -shc *)

on the df results, if you reserve 5% from 19,150,120, you get 18,192,614 which is still a bit below the 18,229,792 you have in use. That is why the 0 bytes available as you are into the 'reserve only' space on the file system. (see the note about tune2fs to manage this)

There shouldn't be any problem running fsck but I don't think it is really needed. If it's an ext4 drive, at least it shouldn't take any time.

When you get that 18,229,792 you have in use down below 18,192,614, you should start to see some free space available.

I also wouldn't worry too much about the camera or thumbdrive except that it means a bit more care to make sure you know which device you are looking at and doing things to.
 
Old 06-03-2011, 01:52 PM   #8
richardhufford
LQ Newbie
 
Registered: May 2006
Location: Safford, AZ, USA
Distribution: Ubuntu 11.04
Posts: 15
Blog Entries: 1

Original Poster
Rep: Reputation: 0
Thank you very much, bryanl and 16pide. I deleted another 40 recup_dir directories and available blocks are showing up. I guess I'll just delete the rest of them and try to come up with another scheme for recovering files. I'll also take a look at tune2fs. It seems like I asked this same basic question a few years ago and got the same answer. I searched for similar posts, too. Oh well!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Ubuntu install in free disk space wiped Windows boot droolinggeezer Linux - Newbie 4 05-29-2011 05:03 PM
[SOLVED] im having trouble adding free disk space to ubuntu noncomputergeek Linux - Newbie 5 01-08-2011 11:27 PM
Help removing free space to create Raw free space nightmare55 Linux - Newbie 11 10-01-2009 04:07 AM
Not enough free space on hard drive with 50g of free space??? auoq SUSE / openSUSE 5 10-13-2004 09:21 PM
Formating free space: WinXP pro and RH9 dualboot with free space on 3rd drive Vermicious Linux - General 2 03-22-2004 06:10 AM


All times are GMT -5. The time now is 01:10 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration