LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Best way to Resize Linux partition ? + kernel remove question (https://www.linuxquestions.org/questions/slackware-14/best-way-to-resize-linux-partition-kernel-remove-question-431221/)

-=Graz=- 04-03-2006 02:51 AM

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

Randux 04-03-2006 03:33 AM

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 &

Alien_Hominid 04-03-2006 09:04 AM

Try http://gparted.sourceforge.net

-=Graz=- 04-04-2006 10:55 AM

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 - ;)

-=Graz=- 04-04-2006 11:00 AM

Quote:

Originally Posted by Alien_Hominid

Oh this looks cool... I might grab a copy now and check it out...
Thanks!!

Alien_Hominid 04-04-2006 11:05 AM

There is also qtparted and their father parted.

-=Graz=- 04-04-2006 11:18 AM

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 ;)

Alien_Hominid 04-04-2006 11:38 AM

If you have kde, use qtparted then.

-=Graz=- 04-04-2006 09:49 PM

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

-=Graz=- 04-07-2006 10:49 AM

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 :)

Alien_Hominid 04-07-2006 11:05 AM

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. :)

-=Graz=- 04-16-2006 01:30 AM

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.. :)

sas_tk 11-26-2006 03:29 AM

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?

Mr_C 11-26-2006 10:39 PM

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.

gnashley 11-27-2006 09:57 AM

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...


All times are GMT -5. The time now is 03:47 AM.