LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Increasing my sda3 partition size on gentoo (https://www.linuxquestions.org/questions/linux-general-1/increasing-my-sda3-partition-size-on-gentoo-551862/)

Kyprioth 05-07-2007 12:41 AM

Increasing my sda3 partition size on gentoo
 
i formatted my hard drive so i had 10 GB being used for gentoo, thinking that i was gonna dual boot with windows, but ive changed my mind, is there any way for me to add my other 110 GB to my sda3 partition?

syg00 05-07-2007 12:56 AM

Lots - but no "no-brainers" unless the space is contiguous and the filesystem supports resize. You could split the space and mount at selected mountpoints (/var and /home come to mind), largely keeping your current partition as-is.
Nice and safe.

If it was me I might just boot the minimal CD and do a "cp -a /dev/<old> /dev/<new>", fix fstab and grub, and then only have the 10 Gig to worry about.
I'd use it as per above.

KISS works best most of the time.

Kyprioth 05-07-2007 01:00 AM

Quote:

Originally Posted by syg00
Lots - but no "no-brainers" unless the space is contiguous and the filesystem supports resize. You could split the space and mount at selected mountpoints (/var and /home come to mind), largely keeping your current partition as-is.
Nice and safe.

If it was me I might just boot the minimal CD and do a "cp -a /dev/<old> /dev/<new>", fix fstab and grub, and then only have the 10 Gig to worry about.
I'd use it as per above.

KISS works best most of the time.

wow... thanks, i never thought of that, ill give it a shot
just hope i dont screw it up, i spent 19 hours setting this up

edit- D= i made a new partition /dev/sda4, used the mke2fs -j to make it ex3 (same as sda3) then copied the files across, changed the root to sda4 (in the grub.conf file), and added the new partition in fstab with the mountpoint being / and setting sda3 to none (mountpoint). so i have sda4 now, and im pretty sure im running off it, however, for some reason it only has 10GB, as if it were sda3

could it be because when i copied i used the command "cp /dev/sda3 /dev/sda4"? wouldnt i need to copy the files, rather than the whole partition?

Kyprioth 05-07-2007 04:38 AM

if i were to just set the mount point to "/" in fstab for both sda3 and sda4, would the space load simply be shared between the two drives?

-arg! is anyone there?! *cries*

also, i noticed that syg00 had a "-a" after his cp. i tried that too, didnt work, all it copied was the lost+found folder

well, ive found a solution on gentoo wiki, but its very dangerous, but i think its my only choice atm:
http://gentoo-wiki.com/HOWTO_move,_resize_partitions

jay73 05-07-2007 05:32 AM

If you really can't seem to get it going, you'll really need a liveCD to move all of /. I think even the gentoo liveCD should be fine. Launch a terminal and

start by mounting sda3:

mkdir /old
mount /dev/sda3 /old

then mount sda4:
mkdir /new
mount /dev/sda4 /new

check whether sda3 is still complete (may have been damaged by the previous attempt - if so, sorry, you're lost...):
ls /old
verify whether the directories are still in place and whether they are not empty

now copy everything from sda3 to sda4:
cd /old
cp -ax * /new/

If all is going well, this should take quite some time. When the prompt returns, you are done.

Verify by going into /new:
cd /new
ls
if you see the same directories as on scd3, you should be fine.

Now edit /etc/fstab:
nano /new/etc/fstab
and put in this line:
/dev/sdc4 / ext3 defaults 1 1
remove the original line that had sdc3 for /

unmount /old and /new:
cd /
umount /old
umount /new

When you reboot, you'll have to press e to edit your gentoo boot line and change root(hd0,2) and /dev/sda3 to root(hd0,3) and /dev/sda4. Afaik, GRUB still depends on sda3; you will probably have to reinstall it once you get into sda4.

syg00 05-07-2007 05:33 AM

Quote:

Originally Posted by Kyprioth
so i have sda4 now, and im pretty sure im running off it, however, for some reason it only has 10GB, as if it were sda3

You need to re-install grub to the MBR (grub-install or root/setup commands).
Quote:

if i were to just set the mount point to "/" in fstab for both sda3 and sda4, would the space load simply be shared between the two drives?
You wish.
Can be made to work with unionfs, but what you've suggested won't do what you want. Try it if you want though - no harm likely.

Try the grub fix.

Kyprioth 05-07-2007 07:03 AM

i tried reinstalling grub just now, after using the wiki solution (which has worked fine btw, but for some reason its still registering as 10GB), i checked using fdisk, and the sda3 partition goes from 69 - the end of my hard drive (before it was going from 69- ~1500 with the sda4 partition going from ~ 1500 to the end)

i have no idea why its not working, i made sure to use

resize2fs /dev/<resized partition> <new_size_in_blocks>
as described in the wiki, and i was doing it while running off the LiveCD

everything i know about linux tells me the information im getting when i right click on the hard drive is wrong, could it possibly be a problem with my wm?

-edit
i just used df -T to check my partitions, and according to that, sda3 only has 7700700 1k blocks, but fdisk says sda3 has "116672062+" blocks

any help?

k ive fixed it, you dont need to define the number of blocks in resize2fs
it asked me to execute another command before it decided to work
but second time, it was fine, so this thread is closed i guess


All times are GMT -5. The time now is 08:24 PM.