Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
Some days ago my system's harddrive started to produce errors, so I had to put in a new one. The new one is somewhat bigger than the old one, but that's ok.
I ghosted (I had to use ghost because other imaging problems didn't want to image an errornous source drive) my old to my new drive. Everything works well, but the root partition on the new drive has the size of the old root partition; a couple of gigabytes remains unused.
How can I resize this partition without loosing all data on it? Is there a clever way to do so?
That says you have root on a nice biggggg partition.
Quote:
Filesystem Size Used Avail Use% Mounted on
/dev/hda6 5.1G 4.0G 851M 83% /
This says that you need to resize the filesystem to fit the partition size.
The partition needs to be in an unused condititon for this so I boot up with a live cd like knoppix.
Note: On my FC3 box the program called e2fsck is not current enough on the live cd so I use the FC3 resue cd for that. You shouldn't have that problem with Suse 9 but thought I'd mention it just in case.
Originally posted by homey That says you have root on a nice biggggg partition.
This says that you need to resize the filesystem to fit the partition size.
The partition needs to be in an unused condititon for this so I boot up with a live cd like knoppix.
Note: On my FC3 box the program called e2fsck is not current enough on the live cd so I use the FC3 resue cd for that. You shouldn't have that problem with Suse 9 but thought I'd mention it just in case.
Code:
e2fsck -f /dev/hda6
resize2fs -f /dev/hda6
Euh.. my / partition is only 7.5Gb big... that's not big, right?
Originally posted by homey Sorry got the numbers mixed up. Do you want to make that partition larger?
Well I have this part of the disk that Fdisk doesn't see (but it must exist; I guess Ghost messed that up) and I want either to add that to the hda6 partition or make a new partition..
Fdisk -l /dev/hda is just on showing you the available unpartitioned space on your drive. If you're interested, I have a script for showing that.
You copy this into a file named test
chmod +x test
Then you run it like this .... ./test /dev/hda
Code:
#!/bin/bash
##### This script calculates hard drive space.
##### example: ./drive /dev/hda
##############################################
# Ensure that root is running the script.
#
WHOAMI=`/usr/bin/whoami`
if [ $WHOAMI != "root" ]; then
echo
echo "You must be root to run this!"
echo
exit 1
fi
##############################################
usage()
{
echo "Usage: $0 /dev/hd#"
exit 1;
}
test "$1" || usage
if ! [ -e $1 ]; then
echo "$1 does not exist. Exiting."
exit 1
fi
if [ -e $1 ]; then
drive=`/sbin/sfdisk -s $1`
echo
for i in `/sbin/sfdisk -l $1 | \
grep -e "^[/dev]" | awk '{print $1}'`;
do
a=`/sbin/sfdisk -s $i 2> /dev/null`
part=$((($a + 0) / 1024))
totalused=$(($totalused + ($a + 0)))
echo "Partition $i used $part MB"
done
echo
else
exit 1
fi
#####
size=$(($drive / 1024))
used=$(($totalused / 1024))
free=$((($drive - $totalused) / 1024 +1))
#
echo " Total drive size $size MB"
echo " Partitioned size $used MB"
echo " Unpartitioned size $free MB"
echo
echo
#####
Device Boot Start End Blocks Id System
/dev/hda1 * 1 125 62968+ 83 Linux
/dev/hda2 126 16383 8194032 5 Extended
/dev/hda5 126 1118 500440+ 82 Linux swap
/dev/hda6 1119 16383 7693528+ 83
Ok , sorry about being the air head today. That shows that your Extended partition /dev/hda2 is way too small. I would ghost your root partition /dev/hda6 to a safe location the remove #6, #5 ,#2 partitions.
Then, using fdisk, recreate the extended partition #2 and have it use up the rest of the drive.
Then, using fdisk, recreate #5 ( as a logical partition ) make it the swap partition and run the command: mkswap /dev/hda5
Then, restore the ghost image to partition #6 and make it the size you want.
Well being a very lazy man i like this (http://www.sysresccd.org/) bootable tools cd. It has parted, a nice partition magic clone and partimage a ghost clone, both of which are easy to use. QtParted is really sweet and runs a quality framebufffer gui thingy and partimage has a simple curses ui, however i have found partimage to be unreliable with ntfs.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.