LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 01-02-2007, 01:56 PM   #1
zero79
Member
 
Registered: Nov 2003
Location: Ohio
Distribution: Debian Unstable
Posts: 460

Rep: Reputation: 30
how to resize the root partition?


hello,

i am running out of diskspace on / and need to resize it. is there any way to do this directly (without relying on some kind of restore or install cd)? is it possible to do this by booting into single user mode and doing some tricks to unmount the root partition? i've tried this, but it won't seem to let me unmount / (because it is in use). thanks.

mike
 
Old 01-02-2007, 02:01 PM   #2
Dutch Master
Senior Member
 
Registered: Dec 2005
Posts: 1,686

Rep: Reputation: 124Reputation: 124
Try resizing your / partition with a Live CD like Knoppix or Ubuntu.
 
Old 01-02-2007, 02:06 PM   #3
rickh
Senior Member
 
Registered: May 2004
Location: Albuquerque, NM USA
Distribution: Debian-Lenny/Sid 32/64 Desktop: Generic AMD64-EVGA 680i Laptop: Generic Intel SIS-AC97
Posts: 4,250

Rep: Reputation: 62
... or maybe the GPartEd LiveCD.

OTOH, maybe you can just figure out a bunch of files to delete.
 
Old 01-02-2007, 03:07 PM   #4
uselpa
Senior Member
 
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507

Rep: Reputation: 47
Do these LiveCDs also resize the file system?
 
Old 01-02-2007, 06:16 PM   #5
zero79
Member
 
Registered: Nov 2003
Location: Ohio
Distribution: Debian Unstable
Posts: 460

Original Poster
Rep: Reputation: 30
i know the gparted cd will work. i've used it before.

like i said, i would prefer to not have to use a live cd to do this if it is possible. i would like to know how to do it easily in the future (rather than digging thru a stack of cds).

thanks.

mike
 
Old 01-02-2007, 06:25 PM   #6
Dutch Master
Senior Member
 
Registered: Dec 2005
Posts: 1,686

Rep: Reputation: 124Reputation: 124
The easy way is a Live CD. Don't be ashamed, the pro's use them also as it saves them valuable time (downtime costs money, if it's a large server it'll cost big bucks...) As said, you may win a few MB's by removing orphaned directories (i.e. programs you've removed but the dir's and it's contents remain)
 
Old 01-02-2007, 07:26 PM   #7
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
You can try removing some packages. I got about 3 GB on / back last time I did that.
 
Old 01-03-2007, 07:32 AM   #8
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
You can add an additional drive or partition then move a directory from under root to a new mount point.. something like /usr or /var maybe..
 
Old 01-10-2007, 06:11 PM   #9
zero79
Member
 
Registered: Nov 2003
Location: Ohio
Distribution: Debian Unstable
Posts: 460

Original Poster
Rep: Reputation: 30
anyone know how to list packages by file size? so i can figure out which ones will be the best to remove?

thanks.
 
Old 01-10-2007, 07:48 PM   #10
Dutch Master
Senior Member
 
Registered: Dec 2005
Posts: 1,686

Rep: Reputation: 124Reputation: 124
I suggest bookmarking this page: http://www.ss64.com/bash/ Use it as a quick reference on which command you need, then read the man-page of that command for it's options and/or syntax

In this case, try du -h Warning! This will cause your terminal to fill up very quickly! Redirect it to a file, like this: du -h > diskusage.txt Better to sort this mess straight away:
Code:
du -h -k | sort -n -r -o sortedfile.txt
Read the resulting file "sortedfile.txt" with your favorite editor.

You've just witnessed the incredible power of the commandline! Be warned though: if you invoke this command and it encounters a file/directory it doesn't have sufficient rights for, you'll get a lot of errors! (i.e: don't invoke this command as a normal user when outside that user's home-dir )

<edit> I've just realised you've asked explicitely for installed packages, not so much large files as such. Then read the man page for the apt-cache command</edit>

Last edited by Dutch Master; 01-10-2007 at 08:12 PM.
 
Old 01-10-2007, 10:17 PM   #11
zero79
Member
 
Registered: Nov 2003
Location: Ohio
Distribution: Debian Unstable
Posts: 460

Original Poster
Rep: Reputation: 30
fyi, i found this slick shell wizardry [1] that lists all packages in order of file size

Code:
dpkg-query -W --showformat='${Installed-Size;10} kB\t${Package}\n' | sort -k1,1n
i found nothing large that i really want to remove, so i will go ahead with using the live cd to resize.

thanks for all the help!

mike

[1] http://www.pixelbeat.org/docs/packaging.html
 
Old 01-10-2007, 10:28 PM   #12
zero79
Member
 
Registered: Nov 2003
Location: Ohio
Distribution: Debian Unstable
Posts: 460

Original Poster
Rep: Reputation: 30
note also that the fslint package will allow you to search your system for packages...and as a bonus will sort by size automatically.

it also looks like it has some other cool capabilities.

mike
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
2006 root partition full. How resize during installation and keep /home intact? Bengan Mandriva 11 01-07-2006 11:29 AM
resize root partition after install Phyrexicaid SUSE / openSUSE 2 08-31-2005 03:38 AM
Resize root partition via reinstall dubya Fedora 0 12-05-2004 01:00 PM
Safe to resize root partition with PM8? Ohmn Mandriva 6 07-09-2004 09:29 AM
how to resize my /root partition Perfekt Linux - Software 4 12-23-2003 09:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

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