Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 33

Thread: HowTo: Transfer your bootable Ubuntu installation between hard drives

  1. #11
    Join Date
    Nov 2007
    Location
    Tacloban City Philippines
    Beans
    29
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: HowTo: Transfer your bootable Ubuntu installation between hard drives

    can i dd a windows partition? lets say the entire windows drive c

  2. #12
    Join Date
    Oct 2006
    Location
    Surrey, UK
    Beans
    168
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: HowTo: Transfer your bootable Ubuntu installation between hard drives

    ASAIK, dd copies block by block from one drive or partition to another. It doesn't care about operating system or even file system so yes, you should be able to use it on Windows as well.

    You should bear two things in mind though:
    1. dd is a Linux utility, so you can't install it on Windows. You'll need to boot to a Linux Live CD on the Windows machine in order to use it.
    2. dd prefers to copy to a partition with similar attributes as the one it's copying from; size, etc.
    In closing, dare I remind you to make sure you've got a good backup of your important Windows data before you start this?
    Alan Rogers || Surrey, UK || Mint Julia, Ubuntu Oneiric || use Search before Post
    Please don't just copy, paste and run code. If you're not sure what it does, ask!

  3. #13
    Join Date
    Jul 2006
    Location
    Ontario, Canada
    Beans
    124
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: HowTo: Transfer your bootable Ubuntu installation between hard drives

    If you can get both plugged in at the same time (maybe you have two internal slots, or an internal slot and an external hard drive case) then it's simply a case of finding the two in /dev and running
    Code:

    sudo dd if=FROM of=TO

    (say you found hda1, which must be copied to sda1)
    Code:

    sudo dd if=/dev/hda1 of=/dev/sda1

    and await finish. Now move on to "then"
    This really goes out to anyone, not just the OP. What if you had a particular folder you wanted this backup to be copied to? Such as...

    sudo dd if=/dev/hda1 of=/dev/sda1/FOLDERNAME

    If it is mounted as /dev/sda1, but the location is actually: /media/MYBOOK/server-bu


  4. #14
    Join Date
    Jul 2006
    Location
    Ontario, Canada
    Beans
    124
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: HowTo: Transfer your bootable Ubuntu installation between hard drives

    Quote Originally Posted by dbqp View Post
    This really goes out to anyone, not just the OP. What if you had a particular folder you wanted this backup to be copied to? Such as...

    sudo dd if=/dev/hda1 of=/dev/sda1/FOLDERNAME

    If it is mounted as /dev/sda1, but the location is actually: /media/MYBOOK/server-bu

    Okay, maybe I asked too quickly without reading through...

    It appears I need to write to:

    sudo dd if=/dev/hda1 of=/MYBOOK/server-bu/file.raw

    ???

    The 'file.raw' is what I need confirmed. Do I name it this exactly or can I name it JAN282008.raw - do I need the raw extension?

    Also, there was mention of overwriting partitions...By writing to this particular location and giving it a file name it restricts it from creating a partition and just backs up data? I don't want to overwrite my external MyBook with 300GB+

  5. #15
    Join Date
    Jul 2006
    Location
    Ontario, Canada
    Beans
    124
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: HowTo: Transfer your bootable Ubuntu installation between hard drives

    ^bump

  6. #16
    Join Date
    Jun 2007
    Beans
    7

    Re: HowTo: Transfer your bootable Ubuntu installation between hard drives

    Hey Old Pink!

    Just wanted to say thank you very MUCH!!!

    Because of experienced guys like you sharing their knowledge its possible to make ubuntu even more user-friendly!

    Thanks again,

    David

  7. #17
    Join Date
    May 2007
    Location
    Pleasant Hill, California
    Beans
    313
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: HowTo: Transfer your bootable Ubuntu installation between hard drives

    I've had some experience moving partitions around, and thought I'd add a few points.

    First, using dd is fine, no problems with that, although I thought there was an issue with how many bytes/blocks to copy at a time (bs = size). That mainly affects speed, though, IIRC. Anyway, I believe you can run gparted from ubuntu itself, and copy/paste a partition, if you have both drives available.

    But, the main thing I wanted to add is that if you are adding a drive rather than replacing it, you need to learn about UUIDs a little if you try to keep both drives at the same time. You will need to change the UUID or delete the old partition. If you need to assign a new UUID, use tune2fs with the -U option to assign a random UUID. When I added a 2nd drive, and rearranged partitions, I learned all about this the hard way.
    -- Marty Fried
    ubuntu @ leftcoast-usa (.) com
    Do Ubuntu
    The Ubuntu Counter Project - user number # 14676

  8. #18
    Join Date
    May 2006
    Beans
    51

    Re: HowTo: Transfer your bootable Ubuntu installation between hard drives

    Is it possible to use, say, if=/dev/hda of=/dev/hdb (instead of "if=/dev/hda1 of=/dev/hdb1" to "if=/dev/hdaN of=/dev/hdbN")? Would save the partioning step and you could just issue one command, go to bed and wake up with a new complete harddrive.

    flostre

  9. #19
    Join Date
    May 2006
    Location
    Switzerland
    Beans
    2,541
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: HowTo: Transfer your bootable Ubuntu installation between hard drives

    Quote Originally Posted by Old Pink View Post
    Remember, with using tar, not everything can be copied if in use
    Not exactly 100% true. "tar" will happily copy whatever it finds on the filesystem. The problem is if e.g. a program is still active and still writing files, it could be that "tar" catches only the last version before the write operation. Workaround: temporarily stop the program in question and let "tar" do its job.

    As for "cp" not catching everything ... There are better alternatives such as "rsync". Feed it with the right parameters and it will happily copy everything incl. the right permissions, e.g.
    Code:
    rsync -av /path/to/local/dir user@remote:/path/to/remote/dir
    Quote Originally Posted by Old Pink View Post
    and you need to to trigger it into keeping file permissions, and avoid certain folders being archived (such as /mnt, /tmp and /proc), and of course, you have to extract everything as soon as it's archived, what a hassle!
    Like with everything, you have to know what you do.

    Quote Originally Posted by Old Pink View Post
    dd just worked perfectly for me, and was very fast and efficient, with absolutely no flaws (most of the time I don't even get prompted to fsck after) and I thought I'd share my method.
    "dd" is OK for as long as you don't care about copying gigabytes and gigabytes of even unused disk space. And "dd" is definitely not the fastest method. As soon as you have to do this over a network or between two harddisks with a very different geometry you'd be better off using something else.

    But for locally attached disks ... OK.

  10. #20
    Join Date
    Apr 2008
    Beans
    21

    Re: HowTo: Transfer your bootable Ubuntu installation between hard drives

    Sorry for the bump (and my poor english), but after a disk failure I'm looking forward to a good backup procedure and after reading this nice how-to I have a question...

    So, once I have cloned the disks... should I clone them again and again or is there a way to update only modified files?

    I mean some way to heve them sync and avoid to clone the whole disk when I all I want is to save the changes...

    Thanks in advance for your time!

Page 2 of 4 FirstFirst 1234 LastLast

Bookmarks

Posting Permissions

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