Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

replace existing disk with larger disk

Status
Not open for further replies.

apocalypse11

Technical User
Jan 11, 2001
77
0
0
AU
Hi Everyone,

I need some guidence on how to replace a 36.4 gig scsi disk in my linux server (running ubuntu) with a 72 gig scsi disk that i just bought. I want to transfer all the files from the 36 on to the 72 as well and make sure linux still treats the disk the same way.

Can you please help me out with this.

Thanx..
 
I presume you have room in the server to connect both disks, at least temporarily? If so, a brief summary would be to:

[ul][li]partition the new disk the way you want it[/li]
[li]create filesystems on the new partitions[/li]
[li]boot up in single-user mode[/li]
[li]mount the partitions under a temporary mount point, say /mnt/newroot for example[/li]
[li]transfer all the data to the new partitions by mounting them in a temporary location, for example:

[tt]cd / ; find . -mount -depth | cpio -vdump /mnt/newroot[/tt]

...repeating for each individual filesystem[/li]
[li]set up your boot loader on the new disk (which one are you using?)[/li]
[li]shut down, switch disks, reboot and hope[/li] :)
[/ul]

Annihilannic.
 
Why don't you just use both disks?



BocaBurger
<===========================||////////////////|0
The pen is mightier than the sword, but the sword hurts more!
 
You could use a drivecopy utility. I've used PowerQuest DriveCopy for years... it rocks.



Just my 2¢

"In order to start solving a problem, one must first identify its owner." --Me
--Greg
 
BocaBurger - I need to replace it because i'm using drbd
gbaughma - is there a drivecopy for linux?

Annihilannic - thanks. i followed these and all seems to have worked well.
 
I'm fairly certain that PowerQuest Drive Copy handles Linux partitions..... it runs it's own OS... so it's not something you install... you boot off of a floppy or CD, select the source and target, then go have dinner. ;)



Just my 2¢

"In order to start solving a problem, one must first identify its owner." --Me
--Greg
 
dd" is what you are looking for.

Boot KNOPPIX or at least single user mode, create the partitions that you want on the new drive (allowing room for growth where you need it).

Code:
dd if=/dev/sda1 of=/dev/sdb1

Repeat for each partition.

Or you could do a file by file copy using "cp -Rv."

You can use qtParted to create the partitions using a graphical program, or parted or fdisk for a curses application.

You can also copy the MBR (if that is where your boot loader is located) using "dd." If forget the exact syntax, but you need to use the raw devices (/dev/sda) and set the block size and count so that only the MBR is duplicated.

The assumption is that you are not using LVM. I haven't dealt with trying to duplicate that before.


pansophic
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top