How to migrate XP, Vista, Linux, BSD and Solaris to a bigger hard disk - Page 8


Page 8 of 12 FirstFirst ... 456789101112 LastLast
Results 106 to 120 of 180

Thread: How to migrate XP, Vista, Linux, BSD and Solaris to a bigger hard disk

  1. #106
    Join Date
    Jun 2004
    Location
    Newcastle upon Tyne
    Posts
    2,978
    Dylanspiritwind,

    Welcome toi Justlinux!


    In answering your questions

    (1) All information are stored in binary bits of either "1" or "0" on a hard disk so the filing system and the operating system is immaterial. In your case you can do either because one of them is your backup so you can do whatever you want even damage the second disk without any consequence to your original system. Thus it may be easier to have two ext3 disks before proceeding to turn one of them into the xfs filing system.

    (2) The answer is yes but it is a lot easier and quicker to use Ubuntu to do it in terminal mode. The details are available in this thread. Forgive me if I do not repeat them here. Just follow the suggestion to put Grub into a pen drive. If you don't want to read it I believe if you insert the sd card and it is recognised as device sdb1 then the Bash terminal command
    Code:
    grubinstall /dev/sdb1
    should be able to achieve the same but I am not sure if it wipes away the existing data in the SD card.

    Migrating Linux is easier than cloning it and you can do it with itself but the safe way is always booting up a Live CD leaving the original system dormant so that its system files are not in active use.

    Key steps are (let us know if you need the missing commands)

    (a) Do it one partition at a time.

    (b) Just create and format another target partition of any size and any filing type (same filing type is always the best).

    (c) Mount both source and target partition. (assuming the source is /dev/sda3 mounted on /mnt/sda3 and target /dev/sdc3 mounted on /mnt/sdc3)

    (d) Change directory to the source /mnt/sda3 (not mandatory but the command below is written assuming you do it) and then copy the entire filing system across by command
    Code:
    tar cf - . | (cd /mnt/sdc3; tar xf -)
    (e) Do whatever necessary to update /etc/fstab to point to the new target partition by keeping or removing the source partition.

    (f) As a rule duplicating a file system using a "copying" command does not copy the boot sector and so the boot loader must be updated separately. dd is the only command that includes the boot sector.
    Linux user started Jun 2004 - No. 361921
    Using a Linux live CD to clone XP
    To install Linux and keep Windows MBR untouched
    Adding extra Linux & Doing it in a lazy way
    A Grub menu booting 100+ systems & A "Howto" to install and boot 145 systems
    Just cloning tips Just booting tips A collection of booting tips

    Judge asked Linux "You are being charged murdering Windoze by stabbing its heart with a weapon, what was it?" Replied Linux "A Live CD"

  2. #107
    Join Date
    Feb 2009
    Posts
    3

    bootable usb backup

    Thank you for your quick reply!

    I did read the link, but it is a bit over my head, are they doing that in grub?

    So my sd card comes up (in diskpartitioner) as sda2 but has 2 partitions on it called sdb1 and sdb2, I am not concerned about any information on it so would I use the command grubinstall /dev/sda2? Being that I have only 1 sd slot to boot my live ubuntu from and no cd/dvd Im not sure I can use the dd command from outside my running system.

    My system is basically as follows:
    eee 900ha (thus no optical drive)
    160gb hd that is partitioned to dual boot (still have the xp on there even though I never use it) and partitioned:
    Sda1:[/B] ntsf/windows
    Sda2: sd card
    sda3: says unknown, 40 mb?
    sda4: extended:
    I believe those are my 4 primary partitions?
    under sda4 it shows: sda5: ntfs, 235mb, not sure what this is for?
    sda6: I think this is my primary linux partition, it has 7.11gb used (will that fit on a 8gb sd card?
    sda7: linux swap
    sda8: fat 32: this is my partition that holds all my documents/music/videos/etc.

    So after installing grub onto the sd card,
    (a). which partitions do I need to copy
    (b). Im not sure I understand the other steps needed here, do I need to do any formatting to the sd card?
    (c,d,f): This is a cf command and is tarred, would it be easier to use the dd command instead here?
    (e). Im not sure I understand this.

    After using Linux for a year, I guess im still a NooB,

    My goal here again: I just want a bootable backup of my eeebuntu os (I have a bootable copy of the original, just want one with all the tweaks I've made), I could settle for a dd backup that I could restore but it would be re-assuring to be able to boot into my system instead of the original version.

    After some searching I found remastersys to create a custom .iso image, could I simply do that then boot into windows and use unetbootin to creat that on a flash drive? I think I will try that now

    If this same result would be possible using the dd command it would be nice, the remastersys does allow to "reinstall" the system just like a live cd when booting from it which is even more ideal for a beginner like me.

    Thanks in advance!

  3. #108
    Join Date
    Jun 2004
    Location
    Newcastle upon Tyne
    Posts
    2,978
    Your sda2 should not be a SD card.

    The information suggests that you have two disks; one sda (a hard disk) and a SD card called sdb.

    I think I have been confused by you as I thought you just want a bootable SD card containing Ubuntu settings. To me that can only be the boot loader Grub and nothing else. If you want the SD card to contain a full working Ubuntu then it is something else.

    You will need to check the Ubuntu forum on making a SD card version as it doesn't appear to be available from the general release the last time I tried it.

    In your case you would be better to resize the partition to squeeze some hard disk space to create say sda9 and put the second Ubuntu there. The second can share the swap partition and just one partition will suffice. You can boot it as another choice in the Grub menu.

    The problem with booting from an SD card is you must nominate the sd card as the first bootable disk before the PC Bios drops the booting to the hard disk. Therefore the SD card will take the sda device name and the internal hard disk is relegated to device sdb. You may have to change the internal settings when using the SD card and then revert back to the original setting if booting the internal hard disk first. You end up with more trouble than its worth.

    Putting two Ubuntu into two partitions simplifies everything.
    Linux user started Jun 2004 - No. 361921
    Using a Linux live CD to clone XP
    To install Linux and keep Windows MBR untouched
    Adding extra Linux & Doing it in a lazy way
    A Grub menu booting 100+ systems & A "Howto" to install and boot 145 systems
    Just cloning tips Just booting tips A collection of booting tips

    Judge asked Linux "You are being charged murdering Windoze by stabbing its heart with a weapon, what was it?" Replied Linux "A Live CD"

  4. #109
    Join Date
    Feb 2009
    Posts
    3

    I should have waited!

    You were so right, I am a bit too *****ious for my own good,

    The theory worked great, Using Remastersys to create the iso image then unetbootin to make a bootable sd card, but my sda 2 was not the sd card....

    So now my computer boots with the unetbootin version (I presume off of sda2, as the sd card is empty) but I have lost my ability to choose between the original version on sda6 and my windows on sda1. I think this method should work once you have the iso (I used unetbootin to installl eeebuntu in the first place, I dont see how it could be any different), just dont make the same mistake I did, I hope I can salvage my original grub menu (or boot menu?).

    I will look for help in another forum that is more on this topic, thanks!

  5. #110
    Join Date
    Sep 2000
    Location
    N California
    Posts
    951
    I just got done replacing the disk in my Dell Inspiron laptop. Since I dual boot between XP and Linux the original 80GB drive was becoming cramped.

    Dell said a 120GB drive was the largest I could use. My local computer store was willing to let me try a 320GB drive and return it if it didn't work.

    The basic clone procedure in the first post worked fine. Took about 90 minutes and the new disk booted to both XP and Linux.

    The problem was that I was unable to use the additional space.

    I won't detail all of the things I tried before the epiphany.

    It's important to remember that laptops from vendors have special partitions for various purposes. I used Partition Magic when I made room for Linux when I first got the Laptop. I also created a "fat32" partition so that I could share files between the two OS's.

    While setting this up I used up the primary partitions and created an extended partition for Linux and Swap. It wouldn't let me resize the extended partition.

    This is what created the problem stated above. I didn't want to disturb the factory partitions. The main goal was to not have to reinstall windows, just give it more space.

    Part of the reason for wanting extra space was to be able to install more than one Linux distro. I was willing to blow away Linux and reinstall. Installing Debian and getting 90% of what I need takes a little over an hour. With the recent release of Lenny and the fact the you can get install disks with your choice of desktop, XFCE, GNOME, and KDE, I wanted to try the XFCE version.

    Of course after deleting the extended partition the laptop wouldn't boot anymore. Grub would fail due to the menu.lst file now missing. I had total confidence that the Linux install would find XP and set-up Grub appropriately. It did!

    Windows did run CHKDSK when it was first booted due to the new larger space.

    Everything is working great. I just have to change the sources to "testing" and do a distribution upgrade.

    This turned out to be a great learning experience. The information in this thread was helpful. I wanted to add my lesson of what might happen if the disk you're trying to clone has used up it's primary partitions and also has an extended partition. It adds complication and some additional planning is needed. The beauty is that the original disk was always safe. I could mess up the new drive without fear that I could start over.


    Thanks,

  6. #111
    Join Date
    Jun 2004
    Location
    Newcastle upon Tyne
    Posts
    2,978
    teeitup,

    Glad you find the procedure works for you.

    To expand an extended partition is more complicated. If the OSes are Linux you don't need to clone them. Just use the tar command and then restore the boot loader one by one.

    It is a good practice to put the extended partition at the rear end of a hard disk. This way you can expand it easily.
    Linux user started Jun 2004 - No. 361921
    Using a Linux live CD to clone XP
    To install Linux and keep Windows MBR untouched
    Adding extra Linux & Doing it in a lazy way
    A Grub menu booting 100+ systems & A "Howto" to install and boot 145 systems
    Just cloning tips Just booting tips A collection of booting tips

    Judge asked Linux "You are being charged murdering Windoze by stabbing its heart with a weapon, what was it?" Replied Linux "A Live CD"

  7. #112
    Join Date
    Sep 2000
    Location
    N California
    Posts
    951
    I did have the extended partition at the end. I thought it was going to be a no brainer. I was disappointed and a little concerned that my original plan didn't work. The idea of 320GB of disk space had grown on me and I didn't want return the disk.

    I found it interesting that the extra space was identified as "unusable" and not "unallocated". This was true in GParted and cfdisk.

    Thanks,

  8. #113
    Join Date
    Jun 2004
    Location
    Newcastle upon Tyne
    Posts
    2,978
    teeitup,

    The hard disk has a standard that every OS uses. One of the standard features is the 4 primary partitions. Basically you can have only more partition by giving up one primary and turn it into an extended partition.

    Inside the extended partition, which is just a boundary, you can have 11 logical partitions (pre-2.6.28 kernel) or 59 logical partitions (post 2.6.28 kernel). The logical partitions must be consecutive because the ith partition carries the address for the i+1 partition. If you delete say the 7th partition the space is dead but the Linux will shift the 8th partition and above up by one space so that the old 8th becomes the new 7th, old 9th become the new 8th etc to maintain the consecutive order, even without telling you!

    If you have space outside the above convention no operating system uses it. That is all.

    Therefore in your case if you have dead space after the end of the logical partitions you can delete a couple of them and move the boundary of the extended partition to take up the dead space.

    Dead space can be easily absorbed by primary partitions but it is more tricky with logical partitions because of the convention. There is a reason for it. If you study the convention you will agree that is the optimum way.
    Last edited by saikee; 03-05-2009 at 08:04 PM.
    Linux user started Jun 2004 - No. 361921
    Using a Linux live CD to clone XP
    To install Linux and keep Windows MBR untouched
    Adding extra Linux & Doing it in a lazy way
    A Grub menu booting 100+ systems & A "Howto" to install and boot 145 systems
    Just cloning tips Just booting tips A collection of booting tips

    Judge asked Linux "You are being charged murdering Windoze by stabbing its heart with a weapon, what was it?" Replied Linux "A Live CD"

  9. #114
    Join Date
    Jan 2003
    Location
    Austin, Texas
    Posts
    683
    Saikee,

    Great thread as always, though I could use your help. I have a drive that is failing on me. My Fedora partition no longer boots and fsck ran overnight without completing. :/

    So, I recently purchased a 500GB drive and planned on cloning my main Linux partition (on /dev/sdb3) over to this drive. The layout is like so (after creating/formatting a 250GB partition on /dev/sdc):

    Code:
    Disk /dev/sda: 400.0 GB, 400088457216 bytes
    255 heads, 63 sectors/track, 48641 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x2b7a2b79
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *           1       48640   390700768+   7  HPFS/NTFS
    
    Disk /dev/sdb: 250.0 GB, 250059350016 bytes
    255 heads, 63 sectors/track, 30401 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x000ebf86
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1   *           1        8355    67111506   83  Linux
    /dev/sdb2            8356        8486     1052257+  82  Linux swap / Solaris
    /dev/sdb3            8487       24421   127997887+  83  Linux
    /dev/sdb4           24422       30401    48034350    5  Extended
    /dev/sdb5           24422       30401    48034318+  83  Linux
    
    Disk /dev/sdc: 500.1 GB, 500107862016 bytes
    255 heads, 63 sectors/track, 60801 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x93c8bb99
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdc1               1       30394   244139773+  83  Linux
    What I would like to do is to copy /dev/sdb3 over to /dev/sdc1. So I booted up the Ubuntu install on /dev/sdb5, mounted sdb3 and sdc1, and then tried the following:

    Code:
    $ cd /media/sdb3
    $ tar cf - . | ( cd /media/sdc1; tar xf -)
    It doesn't work, and the terminal output shows the following:

    Code:
    tar: ./var/lib/dpkg/alternatives/javaws: Cannot open: No such file or directory
    tar: ./var/lib/dpkg/alternatives/jstat: Cannot open: No such file or directory
    tar: ./var/lib/dpkg/alternatives/jmap: Cannot open: No such file or directory
    tar: ./var/lib/dpkg/alternatives/ControlPanel: Cannot open: No such file or directory
    It displays this same message for every file on the entire sdb3 partition. I'm not sure why it would say that either -- clearly the files exist! Did I miss something here?
    "The author of that poem is either Homer or, if not Homer, somebody else of the same name."

  10. #115
    Join Date
    Jun 2004
    Location
    Newcastle upon Tyne
    Posts
    2,978
    I couldn't fault your commands and the method is what I would use normally.

    However if your 250Gb disk sdb is failing then it is possible that filing access will be impeded by the corruption developed.

    Since sdc is 500Gb and larger than the 250Gb of sdb a btter strategy is to clone the entire disk by
    Code:
    dd if=/dev/sdb of=/dev/sdc bs=32256
    AFter the cloning you remove the sdb and hook the 500Gb disk at its position.

    This arrangement has the following advantages

    (1) The 500Gb will function exactly if not better than the 250Gb. The better comes from no corruption as the damaged areas are just bad data instead bad hardware.

    (2) The new 500Gb will boot normally and any undamaged partitions will function perfectly. Thus you can use Ubuntu same as before.

    (3) You test the distressed Fedora. If it boots then the damaged is not serious. In any case you can execute repair with it.

    (4) The original sdb is a backup.

    (5) You can use gparted to expand the partitions later on.

    This scheme does require more work if you resize the partitions but you should be aware of the fact if sdb has corruption the whole disk will eventually go south. Also instead of resizing sdb3 you can always make new sdb6 or sdb7 of any size you want and migrate sdb3 to there without resizing any partition.
    Linux user started Jun 2004 - No. 361921
    Using a Linux live CD to clone XP
    To install Linux and keep Windows MBR untouched
    Adding extra Linux & Doing it in a lazy way
    A Grub menu booting 100+ systems & A "Howto" to install and boot 145 systems
    Just cloning tips Just booting tips A collection of booting tips

    Judge asked Linux "You are being charged murdering Windoze by stabbing its heart with a weapon, what was it?" Replied Linux "A Live CD"

  11. #116
    Join Date
    Jan 2003
    Location
    Austin, Texas
    Posts
    683
    Well I was actually planning on just trashing Fedora. It was a Fedora 11 install that I had just put on there to play with, so there isn't much on there. I guess I could copy just the partition instead of the entire drive. So right now sdb3 is a 128GB partition and sdc1 is a 250GB partition. Will this work as-is without needed to expand the partition, or will I need to pop in gparted and expand sdc1 after copying?

    Code:
    dd if=/dev/sdb3 of=/dev/sdc1 bs=32256
    If it needs expanding, does that mean that I need to destroy sdc1 and recreate it as a 128GB partition, clone sdb3, and then expand? Or is it acceptable to clone it over to the 250GB sdc1 that already exists and then just expand?
    "The author of that poem is either Homer or, if not Homer, somebody else of the same name."

  12. #117
    Join Date
    Jun 2004
    Location
    Newcastle upon Tyne
    Posts
    2,978
    If you clone a partition or the entire disk using dd then you must remember it is a hardware type copying. In it the cloning procedure is controlled by counting sector by sector. This effectively means you can only use dd if the target disk is bigger than the source disk. And in the case of partition-to-partition cloning you need to ensure both partitions are indentical in size, down to the exact number of sectors. Disk-to-disk cloning is a lot saimpler and easier because there is nothing to do except making sure the target is exactly the same size or just larger.

    Therefore dd should only be used for sector-by-sector cloning.

    If you use tar then it is "the filing system" that get copied so the size of the partition is inmaterial! You do have to format the partition first before you can use tar. For dd you don't even need to bother with the partition table, let alone formatting each partition. So the two are totally different methods.

    Linux can be copied from partition to partition without problem as long as you know how to mount the partitions using /etc/fstab and updating the Grub's menu.lst if the partition is used for booting.

    I would not recommend you to use dd if the partition content can be migrated using tar. dd is good if you want simplicity (like cloning the whole disk) and the disk is actually having a read/write error (dd does not deal with the files, it copies the binary bits). If you clone the entire disk then the existing sdc1 will be overwritten.
    Last edited by saikee; 09-20-2009 at 10:57 AM.
    Linux user started Jun 2004 - No. 361921
    Using a Linux live CD to clone XP
    To install Linux and keep Windows MBR untouched
    Adding extra Linux & Doing it in a lazy way
    A Grub menu booting 100+ systems & A "Howto" to install and boot 145 systems
    Just cloning tips Just booting tips A collection of booting tips

    Judge asked Linux "You are being charged murdering Windoze by stabbing its heart with a weapon, what was it?" Replied Linux "A Live CD"

  13. #118
    Join Date
    Jul 2009
    Posts
    30

    Exclamation

    It should be noted with respect to hard drive catastrophies:

    Each time you power it up...may well be the last time you successfully do so

    With that in mind you MUST have an effective plan to immediately rescue your most valuable data FIRST

    This involves the following:

    Do not allow the drive to be energized until you are absolutely ready

    Do not allow others to accidentally energize the drive in your absence

    Do not EVER boot from that hard drive again(until everything of value is rescued at least)

    When you do energize the drive be prepared to immediately go directly to the most valuable data first and get it copied to a safe location immediately

    Do NOT attempt to copy the whole drive

    GO GET YOUR VALUABLE DATA FIRST!

    A large portion of the data on the drive is of absolutely no serious value

    You can easily replace the operating system and each and every piece of additional software and/or driver

    Again, operate under the assumption that the drive will only last another ten minutes

    Go to your most irreplaceable data FIRST and rescue it immediately

    The biggest mistake we see at the service counter and technician's bench is making the assumption that the drive is going to stay operational through ANY specific process

    As the owner of the equipment, consider that each time you turn your machine on...that may be the last time the system operates properly and without any losses

    Hence our worldwide web battlecry...BACK IT UP! SECURE YOUR DATA!

    And for the technician and hobbyist the same holds true and is even MORE important

    You must demand that your friends and patrons give you a list of EXACTLY what must be rescued

    You must demand BOTH what must be rescued AND the order of value(and hence the order in which data will be rescued)

    You must proceed ONLY after an effective and complete plan of action is determined

    Otherwise you will either be physically transplanting your platters into another hard drive to retrieve the data...

    Or...

    You will be paying someone else big money to do it for you

    Again...

    You have been warned!

    So...

    While your hard drive is operating perfectly fine, start backing-up anything and everything that you can't afford to lose FOREVER

    As always, your mileage may vary, buyer beware, and buyer be aware

    We now return you to your regularily scheduled programming

    .

  14. #119
    Join Date
    Jan 2003
    Location
    Austin, Texas
    Posts
    683
    LewRockwell -- what a post!

    I will say that I have already backed up all of my important stuff already, so I definitely have that covered. Thanks for the advice though.
    "The author of that poem is either Homer or, if not Homer, somebody else of the same name."

  15. #120
    Join Date
    Jan 2003
    Location
    Austin, Texas
    Posts
    683
    Quote Originally Posted by gamblor01 View Post
    What I would like to do is to copy /dev/sdb3 over to /dev/sdc1. So I booted up the Ubuntu install on /dev/sdb5, mounted sdb3 and sdc1, and then tried the following:

    Code:
    $ cd /media/sdb3
    $ tar cf - . | ( cd /media/sdc1; tar xf -)
    It doesn't work, and the terminal output shows the following:

    Code:
    tar: ./var/lib/dpkg/alternatives/javaws: Cannot open: No such file or directory
    tar: ./var/lib/dpkg/alternatives/jstat: Cannot open: No such file or directory
    tar: ./var/lib/dpkg/alternatives/jmap: Cannot open: No such file or directory
    tar: ./var/lib/dpkg/alternatives/ControlPanel: Cannot open: No such file or directory

    Just a heads up for Saikee and everyone else, this appears to have failed because I was trying to sudo it like so:

    Code:
    $ sudo tar cf - . | ( cd /media/sdc1; tar xf -)
    This failed with the errors I mentioned above. On a whim I thought that perhaps running sudo -i and then retrying the command would work...IT DID! So make sure you are truly root and not just trying to run the command via sudo.

    So, the complete set of steps I ran to copy all files from /dev/sdb3 to /dev/sdc1 was:

    Code:
    $ sudo -i
    # mkdir /media/sdb3
    # mkdir /media/sdc1
    # mount /dev/sdb3 /media/sdb3
    # mount /dev/sdc1 /media/sdc1
    # cd /media/sdb3
    # tar cf - . | ( cd /media/sdc1; tar xf -)

    I have been checking it and it is definitely copying everything over. I might need to reinstall grub on the drive (though the tar command should be copying over all of the /boot/grub directory, though my UUID will change as will the partitions), and I also need to create a swap partition. Then I should be able to disconnect sdb and put sdc in its place, boot it up, and hope for the best! I'll post an update later today.
    Last edited by gamblor01; 09-22-2009 at 11:34 AM.
    "The author of that poem is either Homer or, if not Homer, somebody else of the same name."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •