LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 05-14-2010, 08:34 PM   #1
terry-duell
Member
 
Registered: Jan 2007
Location: Melbourne, Australia
Distribution: Fedora 38 x86_64
Posts: 539

Rep: Reputation: 59
Is there a way to upgrade and move to new hard disc?


Hullo All,
I have F12 on a 160GB disc, and am now looking to upgrade to F13, but also move the whole system to a 500GB disc.
Is there a relatively painless/simple way to do this?

Cheers,
Terry
 
Old 05-14-2010, 08:54 PM   #2
yooy
Senior Member
 
Registered: Dec 2009
Posts: 1,387

Rep: Reputation: 174Reputation: 174
with dd command should pretty simple, there may be some problems about different size of disks and if you don't know grub and mbr much
 
Old 05-15-2010, 12:19 AM   #3
terry-duell
Member
 
Registered: Jan 2007
Location: Melbourne, Australia
Distribution: Fedora 38 x86_64
Posts: 539

Original Poster
Rep: Reputation: 59
Quote:
Originally Posted by yooy View Post
with dd command should pretty simple, there may be some problems about different size of disks and if you don't know grub and mbr much
OK. That implies the new disk ends up with the same partitioning as old, doesn't it?
Given the problems the 200MB /boot caused using preupgrade to go from F11 to F12, it would be nice to be able to have a larger /boot on the new disk.
If one is able to readily enlarge partitions on the new disk after the using dd to copy old to new, then it probably isn't such an issue, but I really don't know about that.
I don't know much (anything useful) about grub or mbr, so I am guessing that use of dd doesn't automagically reproduce the boot record on the new disk, and that grub would need to be edited to point to the new disk...a lot of guessing here.
It sounds like this approach might have a few problems for the unwary.
I'm not against using dd, just that I really need to do some homework first. It would be nice to see the steps that I would have to go through.
Is there any other approach one can use that I could think about?

Thanks for your help,
Cheers,
Terry
 
Old 05-15-2010, 02:07 AM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,104

Rep: Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117
dd is about the worst option.
Create new partitions on the new disk and use a file-system aware copy (from a liveCD) to do the job - "cp -a ..." or rsync, or ...
That way you find about any errors in the files when you do the copy - dd is very remiss in this area.
You could of course use a backup tool like clonezilla or amanda ...

Grub will need to be setup, but that's no big deal - use the CLI and write the new MBR yourself (from the liveCD). Easier with the old grub (which Fedora uses) rather than grub2.
 
Old 05-15-2010, 06:37 PM   #5
terry-duell
Member
 
Registered: Jan 2007
Location: Melbourne, Australia
Distribution: Fedora 38 x86_64
Posts: 539

Original Poster
Rep: Reputation: 59
Quote:
Originally Posted by syg00 View Post
dd is about the worst option.
Create new partitions on the new disk and use a file-system aware copy (from a liveCD) to do the job - "cp -a ..." or rsync, or ...
That way you find about any errors in the files when you do the copy - dd is very remiss in this area.
You could of course use a backup tool like clonezilla or amanda ...

Grub will need to be setup, but that's no big deal - use the CLI and write the new MBR yourself (from the liveCD). Easier with the old grub (which Fedora uses) rather than grub2.
OK, so the suggestion is to partition the new disk then copy files across. Gparted seems to be the common tool to do the partitioning, but that cannot handle LVM, can it? Perhaps that doesn't matter?
I had a look at cp -a, but couldn't quite see how the -a would help me. Probably missed something so more homework needed there.
I had a look at rsync and although there are a lot of examples I didn't see anything specific to copying from one device to another on the same machine. Again a lot more homework needed here to be sure of how to specify source and dest. My initial assumption is that one would need to do it as root (ie sudo rsync ...) use options to preserve ownership and modification times, and copy / to /, /boot to /boot and so on, or is there a smarter way of doing this?
My understanding of clonezilla is that it will give me a clone of my existing disk (160MB) on my new disk (500MB). Doesn't that leave me with the problem of how to expand partitions (eg make /boot 250 or 300MB for example). Also the F12 partitioning on the 160MB disk is LVM, how do I alter that on the new disk, or don't I have to?
As I said, I really don't know much about grub or MBR, so setting up grub and writing the MBR myself sounds like Greek to me. Could you please be a bit more specific on what is needed to do these things?

Thanks for your help.
I now need to get some details.

Cheers,
Terry
 
Old 05-15-2010, 07:26 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,104

Rep: Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117
Quote:
Originally Posted by terry-duell View Post
... or is there a smarter way of doing this?
Nope - dumb is good.
Ugh, LVM - I never use it, but it is really just another block device layer, so the same principles apply. Set up PV(s), VG(s) and LV(s) on the target, and proceed as normal.
The reason for "-a" on the cp is it does all the work for you - it recurses down directories, and maintains all attributes. KISS.
Works really well - just do partition by partition (or LV by LV)
Amanda or clonzilla would be overkill, but I mentioned them for completeness.

For grub, hopefully your /boot is non-LVM - make sure you do likewise on the new disk; make it the first partition. The from the liveCD terminal you can (as root) do this
Code:
grub
root (hd1,0)
setup (hd1)
quit
(presumes the new disk is seen as the second hard-disk from the liveCD (counts from zero). "fdisk -l" will tell you that.

Edit: you might need to adjust your menu.lst on the new disk - maybe not depending on how it is setup; likewise /etc/fstab.

Last edited by syg00; 05-15-2010 at 07:28 PM.
 
Old 05-15-2010, 10:01 PM   #7
terry-duell
Member
 
Registered: Jan 2007
Location: Melbourne, Australia
Distribution: Fedora 38 x86_64
Posts: 539

Original Poster
Rep: Reputation: 59
Quote:
Originally Posted by syg00 View Post
Nope - dumb is good.
Ugh, LVM - I never use it, but it is really just another block device layer, so the same principles apply. Set up PV(s), VG(s) and LV(s) on the target, and proceed as normal.
The reason for "-a" on the cp is it does all the work for you - it recurses down directories, and maintains all attributes. KISS.
Works really well - just do partition by partition (or LV by LV)
[snip]
OK, sorry to be a bit dense, but I have no idea what PV(s) or VG(s) are. Guessing that LV(s) are Logical Volumes.
I think I understand your approach.
In the meantime I have been thinking more about this, and have come up with a scheme/approach that I think would avoid all the issues that my simple (old codger's) mind sees as potential disaster areas...
- disconnect existing disk (sda) and connect new disk in place
- boot F12 distro media, install F12 using a custom partitioning scheme (/boot = 300MB say, and /home)
- reconnect old disk as sda, connect new disk as sdx (whatever system wants it to be)
- mount sdx as /fred
- use rsync to copy to new disk, with appropriate options to preserve ownership, dates etc,
sudo rsync / /fred
sudo rsync /boot /fred/boot
sudo rsync /home /fred/home
- disconnect old disk, reconnect new disk as sda, boot into F12
- When F13 released
save repo data
download F13 repo data
yum upgrade

- If F13 all OK, then clean old disk and mount as data disk

Now that I have set it all out, it does sound a bit long winded, but does have the advantages of Fedora doing the partitioning and the boot record and grub are all sorted without me having to manually fiddle around in stuff I don't know about.

Will it all work, or have I missed something, or more to the point, misunderstood?

Cheers,
Terry
 
Old 05-15-2010, 10:30 PM   #8
brucehinrichs
Member
 
Registered: Mar 2008
Location: US
Distribution: Debian Sid; Sabayon, UbuntuStudio, Slackware-multilib 13.1, Peppermint Ice, CentOS
Posts: 575

Rep: Reputation: 69
If I were doing it, I would wait for FC13, partition the 500GB disk and do a fresh install. Then I would transfer whatever data, scripts, conf files, and anything else I wanted to keep from the old system. If possible, I would keep the old HD around somewhere, in case I missed transferring anything. My
 
Old 05-16-2010, 12:07 AM   #9
terry-duell
Member
 
Registered: Jan 2007
Location: Melbourne, Australia
Distribution: Fedora 38 x86_64
Posts: 539

Original Poster
Rep: Reputation: 59
Quote:
Originally Posted by brucehinrichs View Post
If I were doing it, I would wait for FC13, partition the 500GB disk and do a fresh install. Then I would transfer whatever data, scripts, conf files, and anything else I wanted to keep from the old system. If possible, I would keep the old HD around somewhere, in case I missed transferring anything. My
Hullo brucehinrichs,
Your suggestion has certainly been one of the options that I have been considering. The only thing that has put it off the top of the list is all the business of getting the new install setup as my F12 now is, with all the additional libs and apps etc. Everytime I do a fresh install I find it takes ages to get it all sorted. That's why I have been favouring the rsync and upgrade option.
I used preupgrade to go from F11 to F12, and apart from the business of ensuring /boot had enough space, I would say it is good approach. I thought that if I could set up suitable partitions, and get F12 copied across OK, then preupgrade to F13 would be OK. I would still keep the old disc around for a while at least to be sure, as you suggest.
It is not cut and dried yet, and no real rush to have anything done until F13 is released, which is now 25/5 I think, so I'll think about it some more.

Thanks for your two cents, it is appreciated.

Cheers,
Terry
 
Old 05-16-2010, 10:41 AM   #10
DrLove73
Senior Member
 
Registered: Sep 2009
Location: Srbobran, Serbia
Distribution: CentOS 5.5 i386 & x86_64
Posts: 1,118
Blog Entries: 1

Rep: Reputation: 129Reputation: 129
Thing to watch for is device names of the partitions.

My suggestion, done several times on CentOS (that also uses LVM) is:

Use LiveCD to create /boot partition you like and just "cp -a" files from one old boot partition to the new one. If when replacing the new HDD it gets new device name (like old is IDE and new is SATA) you might need to edit /boot/grub/grub.conf and possibly device.map or similar file to reflect the change. Then install grub to MBR of the new HDD (you can do that in the end also, there is no hurry).

Since LVM partition can be moved with dd without any problems, I did it using base device names (like "dd if=/dev/sda2 of=/dev/db2") but you need to duplicate exact size of the partition to avoid repairs to the new partition.

Then all you need to do is to create additional partitions on the new HDD and boot (do not forget grub install on the new HDD).
 
Old 05-18-2010, 07:10 PM   #11
terry-duell
Member
 
Registered: Jan 2007
Location: Melbourne, Australia
Distribution: Fedora 38 x86_64
Posts: 539

Original Poster
Rep: Reputation: 59
Quote:
Originally Posted by DrLove73 View Post
Thing to watch for is device names of the partitions.

My suggestion, done several times on CentOS (that also uses LVM) is:

Use LiveCD to create /boot partition you like and just "cp -a" files from one old boot partition to the new one.
[snip]
Thanks for that advice.
I think I now have it figured out.

Many thanks also to all who replied.

Cheers,
Terry
 
Old 05-19-2010, 02:03 AM   #12
DrLove73
Senior Member
 
Registered: Sep 2009
Location: Srbobran, Serbia
Distribution: CentOS 5.5 i386 & x86_64
Posts: 1,118
Blog Entries: 1

Rep: Reputation: 129Reputation: 129
If you need LiveCD with LVM and RAID support (mdadm) then you can try my own LiveCD file: http://rpms.plnet.rs/centos5-i386/Ce...386-LiveCD.iso

It is rather old (CentOS 5.3) so I do not know if ext4 is working!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trying to reformat my hard disc Billy Makk General 15 12-16-2009 08:22 PM
Instals can't see hard disc newburydes Linux - Newbie 3 06-20-2007 06:35 AM
read only hard disc laleh Linux - Hardware 1 10-30-2006 06:40 AM
Help - Installation on second hard disc bulle555 Linux - Software 8 06-18-2006 02:56 AM
Hard disc corruption!?! brit_spears20 Linux - Newbie 3 04-30-2001 04:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 10:00 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