LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices



Reply
 
Search this Thread
Old 04-03-2006, 03:51 AM   #1
-=Graz=-
Member
 
Registered: Jan 2006
Location: Australia
Distribution: Fedora, Slackware, RHEL, AIX, HP-UX
Posts: 356

Rep: Reputation: 31
Best way to Resize Linux partition ? + kernel remove question


I would like to increase the size of my Linux partition. I made the mistake of doing it in partition magic in windows once which Linux wasnt very happy about at all... What is the best way to do it on a Dual Boot system With Linux and Windows XP.
XP has both NTFS and Fat32 Partitions...

Also, the updating ldconfig when my machine boots.. It seems to take longer and longer.. Are links to each kernel i have compiled listed in this thing? What is the best way to remove a kernel once i am done with it or have progressed further.
If i simply delete /usr/src/linux-2.6.xx will there still be links to this everywhere in the system?

Thanks in advance
 
Old 04-03-2006, 04:33 AM   #2
Randux
Senior Member
 
Registered: Feb 2006
Location: Siberia
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705

Rep: Reputation: 54
Quote:
Originally Posted by -=Graz=-
I would like to increase the size of my Linux partition. I made the mistake of doing it in partition magic in windows once which Linux wasnt very happy about at all... What is the best way to do it on a Dual Boot system With Linux and Windows XP.
XP has both NTFS and Fat32 Partitions...
There are two easy ways to do this. Basically, you make a backup and then restore it in the larger partition. It just depends on how you want to do the backup. You can use tar (and gzip or bzip2) or partimage, or something else. If you have your linux mounted from more than one partition, you have to make multiple backups.

1. make a backup
2. delete the partition with fdisk
3. create a new (bigger) partition with fdisk
4. make a filesystem (mkfs, mkreiserfs, etc)
5. restore the backup into the partition

You should have a live CD if you are going to do anything with linux. Kanotix is very good, it has many tools, including partimage. Partimage is a console app which you can use to make backups and restore them (but they always have to be restored in a partition which is at least as big as the one you made the backup from. Sometimes this isn't good. If you had a 10G partition but were only using 5G, you can restore this partimage backup in a 6G partition)

Or you could just do

Code:
tar -cvjf mysystem.tar.bz2 /
and then when you have your new partition created

Code:
tar -xvjf mysystem.tar.bz2
Quote:
Originally Posted by -=Graz=-
Also, the updating ldconfig when my machine boots.. It seems to take longer and longer.. Are links to each kernel i have compiled listed in this thing? What is the best way to remove a kernel once i am done with it or have progressed further.
If i simply delete /usr/src/linux-2.6.xx will there still be links to this everywhere in the system?
Thanks in advance
The sources don't cause any problems. And nothing should be linked to source. ldconfig updates a cache of shared libraries. If it's taking a long time, you can change the invocation to run as a background process by adding & to the invocation and then your start up will not wait for the cache to be built before continuing.

Code:
/sbin/ldconfig &
 
Old 04-03-2006, 10:04 AM   #3
Alien_Hominid
Senior Member
 
Registered: Oct 2005
Location: Lithuania
Distribution: Hybrid
Posts: 2,247

Rep: Reputation: 53
Try http://gparted.sourceforge.net
 
Old 04-04-2006, 11:55 AM   #4
-=Graz=-
Member
 
Registered: Jan 2006
Location: Australia
Distribution: Fedora, Slackware, RHEL, AIX, HP-UX
Posts: 356

Original Poster
Rep: Reputation: 31
randux - thanks for your reply. This is a great help!
I had no idea that this would be the approach to take. I have quite a few bootable linux discs, one of which i think is deigned for this type thing now i think about it...
well i only have a 8 GB partition reserved for linux at the moment. I think i will delete it and create a 20GB one or 2 x 10GB ones...

I will have to gove this a go over the next couple of days but looks good to me!
thanks again, i will post the outcome -
 
Old 04-04-2006, 12:00 PM   #5
-=Graz=-
Member
 
Registered: Jan 2006
Location: Australia
Distribution: Fedora, Slackware, RHEL, AIX, HP-UX
Posts: 356

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by Alien_Hominid
Oh this looks cool... I might grab a copy now and check it out...
Thanks!!
 
Old 04-04-2006, 12:05 PM   #6
Alien_Hominid
Senior Member
 
Registered: Oct 2005
Location: Lithuania
Distribution: Hybrid
Posts: 2,247

Rep: Reputation: 53
There is also qtparted and their father parted.
 
Old 04-04-2006, 12:18 PM   #7
-=Graz=-
Member
 
Registered: Jan 2006
Location: Australia
Distribution: Fedora, Slackware, RHEL, AIX, HP-UX
Posts: 356

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by Alien_Hominid
There is also qtparted and their father parted.
okthen - i just got:
gtkmm-2.8.0
parted-1.6.25.1
gparted-0.2.3
Looks like there is anther library i will need as well... after doing a ./configure on each. I think i have uninstalled a bunch of Gnome stuff coz i have been using kDE.
I might just go for the tarballing and manuall delete/create of partition at this stage..

It is 2am right now and i gotta get up for work at 6am so i had best forget about this for the day
 
Old 04-04-2006, 12:38 PM   #8
Alien_Hominid
Senior Member
 
Registered: Oct 2005
Location: Lithuania
Distribution: Hybrid
Posts: 2,247

Rep: Reputation: 53
If you have kde, use qtparted then.
 
Old 04-04-2006, 10:49 PM   #9
-=Graz=-
Member
 
Registered: Jan 2006
Location: Australia
Distribution: Fedora, Slackware, RHEL, AIX, HP-UX
Posts: 356

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by Alien_Hominid
If you have kde, use qtparted then.
Thanks Alien Hominid, i might have a look at this when i get home tonight.. Pretty tired though after staying up so late last night
Cheers, G
 
Old 04-07-2006, 11:49 AM   #10
-=Graz=-
Member
 
Registered: Jan 2006
Location: Australia
Distribution: Fedora, Slackware, RHEL, AIX, HP-UX
Posts: 356

Original Poster
Rep: Reputation: 31
okay i managed to foul up my whole system trying to do this... LOL...
did not have enough space on my linux partition to dump the file so i tried to create some more space in partition magic.... Oh my what a mess... the names of /dev/hdx all changed and fstab was wrong as well as lilo..
Managed to boot into SLAX live CD and use #cfdisk to delete the new partition i created. i then had to go back into fstab and change all the values as the kernel wrote a bunch of botch stuff in there on the failed boot..
I have since removed an old 30gb hd from a laptop and chucked it in a USB2 external caddy.. created a 15GB fat32 parition on there.
#mount /dev/sda1 /mnt/fat32 vfat
#tar -cvjf /mnt/fat32/mysystem.tar.gz /

Seems to be working pretty good.... (except it also archived the /mnt/fat32 dir.... LOL) <- only had 35MB file in there at the time though. Had to also #umount all other drives first as it tried to add my ntfs volumes into the tarball too .. hehe...

Oh i made a bit of a mess of this... But i cant really go wrong from here.. I was very lucky to salvage the system
I also downloaded the x86 Linux system recovery boot cd, but qparted did not want to work...
This time i am going to build the system so i can do proper maintenance in the future. I have a Dell laptop and there were 2 x other primary partitions with Dell system recovery stuff in them too - which made things worse..
Thanks for your help though, seems to be working
 
Old 04-07-2006, 12:05 PM   #11
Alien_Hominid
Senior Member
 
Registered: Oct 2005
Location: Lithuania
Distribution: Hybrid
Posts: 2,247

Rep: Reputation: 53
Quote:
Originally Posted by -=Graz=-
Seems to be working pretty good.... (except it also archived the /mnt/fat32 dir.... LOL) <- only had 35MB file in there at the time though.
That's good for you.
 
Old 04-16-2006, 02:30 AM   #12
-=Graz=-
Member
 
Registered: Jan 2006
Location: Australia
Distribution: Fedora, Slackware, RHEL, AIX, HP-UX
Posts: 356

Original Poster
Rep: Reputation: 31
i ended up using parted to do this which worked perfectly.... and compressed 7GB down to 1.9GB with the standard options. I then used fdisk to delete/re-create the new partition. i have a problem now however with the filesystem. it thinks it is still 9GB instead of 19GB. I did not use 'mkf s' to re-create the filesystem.. i just created a partition of 'type' - linux in fdisk..
I tried to use parted resize option and it doesnt seem to happy... says i have a 'strange' ext2 fileystem LOL..
 
Old 11-26-2006, 04:29 AM   #13
sas_tk
LQ Newbie
 
Registered: Aug 2006
Posts: 3

Rep: Reputation: 0
Hi

Was resizing "/" and "/home". Have Suse 10.1

- downloaded Knoppix Live cd
- started Knoppix, did partimage to backup / and /home
- deleted both partitions
- created new / and new /home partitions
- restarted
- did mkreiserfs
- restored data to / and /home using partimage
- modified /etc/fstab to reflect new partitions
- rebooted from HDD
- started Suse.

Questions:
Why df -h still shows old space
I tried to go to software installation to add some packages and still got message that don't have enough space

- when I go to LVM or Partitioner - they show the right space for / and /home

What I did wrong?
 
Old 11-26-2006, 11:39 PM   #14
Mr_C
Member
 
Registered: Jan 2004
Location: Trinidad & Tobago
Distribution: Slackware
Posts: 317

Rep: Reputation: 30
weee this sounds like fun. I was doing something like this a earlier this year http://www.linuxquestions.org/questi...move+partition
It may be an interesting read for you.

WRT your senario, seeing that (1) you have your filesystems archived on another hdd(2) parted is bitching, why not just delete like mad and recreate new partitions? Make sure your create a filesystem this time like 'mkreiserfs /dev/hdX' if your have ide or sda for sata, Before you start untaring.
 
Old 11-27-2006, 10:57 AM   #15
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,775

Rep: Reputation: 481Reputation: 481Reputation: 481Reputation: 481Reputation: 481
I've rescued 2 other programs from oblivion which are based on parted:

http://distro.ibiblio.org/pub/linux/...s/nparted-0.2/

http://distro.ibiblio.org/pub/linux/...ts/gtk-parted/

These both use an earlier version of libparted. I've configured nparted so that libparted is linked statically -still have that to do for gtk-parted although I'm more interested in updating them both to use later versions of libparted. You probably won't find these programs anywhere else...
 
  


Reply

Tags
backup, partition


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
how to resize linux partition gry-HuhuY5 Linux - General 6 08-13-2005 08:07 PM
Resize the linux partition guideweb Linux - Software 5 08-07-2005 10:22 PM
resize linux partition ConfusedMonkey Linux - Newbie 9 07-31-2005 03:22 PM
Resize Linux partition perigee Linux - General 3 11-28-2004 06:48 AM
How to resize a linux partition? jadermf Linux - General 4 01-16-2004 02:02 PM


All times are GMT -5. The time now is 10: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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration