LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-12-2003, 09:16 PM   #1
aveach
LQ Newbie
 
Registered: Feb 2003
Posts: 4

Rep: Reputation: 0
Repartioning?


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
 
Old 02-12-2003, 09:23 PM   #2
emetib
Member
 
Registered: Feb 2003
Posts: 484

Rep: Reputation: 33
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.
 
Old 02-12-2003, 09:41 PM   #3
aveach
LQ Newbie
 
Registered: Feb 2003
Posts: 4

Original Poster
Rep: Reputation: 0
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
 
Old 02-12-2003, 09:53 PM   #4
cuckoopint
Member
 
Registered: Feb 2003
Distribution: Debian
Posts: 797

Rep: Reputation: 30
Quote:
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
yeah...so 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!

Luck!
 
Old 02-13-2003, 02:07 AM   #5
fancypiper
LQ Guru
 
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 60
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:
Code:
[phil@fancypiper phil]$ su -
Password: 
[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
Code:
[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
mkswap

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
Code:
[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!

Last edited by fancypiper; 02-13-2003 at 02:14 AM.
 
Old 02-13-2004, 06:03 PM   #6
Present
Member
 
Registered: Jan 2004
Distribution: suse/slack/gentoo/lfs (not-in-that-order)
Posts: 284

Rep: Reputation: 30
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.

GL
 
  


Reply



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
Suse/Yast PC frozen during repartioning - what to do? Yardhill Linux - Newbie 1 02-05-2005 08:17 PM
Repartioning a Drive From MDK 10.1 to Install Mephis Junior41180 Linux - General 1 01-18-2005 05:04 AM
repartioning linux russell108 Linux - Newbie 8 12-07-2004 07:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:09 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
Open Source Consulting | Domain Registration