-   Linux - Newbie (
-   -   Repartioning? (

aveach 02-12-2003 09:16 PM

Hi, I have Red Hat 7.3 installed on a 7gig disk currently. I am going to clone it over to a 30 gig disk. I was wondering what is the best program to use to increase the size of my existing partitions into the unused 23 gigs of space? Thanks

emetib 02-12-2003 09:23 PM

is it on the same box?

i would mount them (partitions) cp -a them (/dirs/files) and then edit your /etc/fstab. this would be the quickest way. you could have it done in less than 15 min without any problems.

for your /etc/fstab, just take a look at what you have in it and then change the /dev/hd? to what the new one is. change it in your new one. if you are going to switch the placement of your hds, from being hda now to hdb later you wouldn't even have to worry about your boot process in your bios. if you are going to keep them the same then go into your bios and change where to boot from first.

good luck.

aveach 02-12-2003 09:41 PM

OK, I'm pretty new so i dont really understand what you are suggesting. The disk is going to be an old windows ntfs disk that i am taking out of an old box. Thanks

cuckoopint 02-12-2003 09:53 PM


Originally posted by aveach
OK, I'm pretty new so i dont really understand what you are suggesting. The disk is going to be an old windows ntfs disk that i am taking out of an old box. Thanks you picked up so new disk. pop it into the computer, hook it up, and boot your computer. make sure bios recognizes it. then login and get yourself to some terminal. fdisk the new HD and create the partitions you want. mount these new partitions. then copy (you might want to read the cp manpage for any options you need) everything to the new partition. if you plan on removing the old drive, shutdown, remove it, and reinstall the new HD as a primary (vs. slave). boot back in and everything should be a-ok. I'm not sure if my dribble is clear enough. if not, speak up! ;)


fancypiper 02-13-2003 02:07 AM

Physically install the hard drive in the box and make sure bios recognises the drive. I will assume it is hooked up on ide1 as slave which Linux will call /dev/hdb. Alter to fit how you install the drive. Boot into your Linux user's account in a gui if you wish and open an x terminal and give these commands:

[phil@fancypiper phil]$ su -
[root@fancypiper root]# fdisk /dev/hdb

Some people prefer cfdisk.

Create your partition scheme. For a home Linux box, I like primary partitions:
/boot - 20 - 100 mb, not necessary if you use ext3/3 fs for /
swap - 128 mb
/ 3-5 gig depending on software wanted
/home - the rest of the drive

Save the partition table by exiting with w. Wipe the first part of each partition to make sure it is cleaned of extraneous microsoft stuff

[root@fancypiper root]# dd if=/dev/zero of=/dev/hdxy bs=1K count=1
Make your filesystems with the mkfs commands

mke2fs /dev/hdXX fot ext2fs
mke2fs -j /dev/hdXX fof ext3fs
mkreiserfs dev/hdXX - reiserfs
mkfs.xfs dev/hdXX - xfs

Next/ make 2 directorys, say /mnt/source and /mnt destination

Mount your current os on /mnt/source
Mount the newly partitioned drive on /mnt destination, making the needed sub directories to mount the partitions.

Next, clone the system by piping over with tar

[root@fancypiper root]# cd /mnt/source
[root@fancypiper root]# tar cf - . | (cd /mnt/destination && tar xBfp -)

When finished, you can use that drive installed in the original position.

Next, install a bootloader on the mbr of the drive if it is installed as /dev/hda

Installing a bootloader

If installed somewhere else, edit /etc/fstab and /boot/grub/grub.conf to reflect your changes.

Try that with Windows!

Present 02-13-2004 06:03 PM

remember if you are installing grub to a dedicated /boot partition and will be writing to the boot sector of the /boot partition instead of mbr, that you must use a fs DIFFERENT than xfs. grub will invalidate an xfs partition if you chain load TO grub on an xfs partition (grub writes to boot sector of xfs).

if you will be using grub for all your bootloading tasks, or chainload FROM grub. just install to mbr and you're cool.


All times are GMT -5. The time now is 10:46 AM.