Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Copy Ubuntu Server 8.04 LTS from IDE Hard Drive To USB Drive

  1. #1
    Join Date
    Aug 2008
    Beans
    6

    Copy Ubuntu Server 8.04 LTS from IDE Hard Drive To USB Drive

    I have installed Ubuntu Server 8.04 LTS on an IDE hard drive. I have setup samba on the server. I would like to transfer the operating system to a USB thumb drive so that I can boot and run the same computer from the thumb drive and get rid of the IDE Hard Drive. What is the easiest way to do this? Thanks.

  2. #2
    Join Date
    Jun 2008
    Location
    New York, USA
    Beans
    781

    Re: Copy Ubuntu Server 8.04 LTS from IDE Hard Drive To USB Drive

    Quote Originally Posted by wbelk7777 View Post
    I have installed Ubuntu Server 8.04 LTS on an IDE hard drive. I have setup samba on the server. I would like to transfer the operating system to a USB thumb drive so that I can boot and run the same computer from the thumb drive and get rid of the IDE Hard Drive. What is the easiest way to do this? Thanks.
    Use the "dd" command.

    First, boot up your Ubuntu system and plug in your USB drive.

    Next, find out what the device names are:


    Code:
    sudo ls -laF /dev/disk/by-id
    Figure out which device is your Ubuntu drive and which is your USB drive.

    Hopefully, both drives are the same size? If not, the partition table mismatch will give you grief.

    Next, copy one to the other. Note that in the following example, I will use "/dev/sda" as the Ubuntu drive and "/dev/sdb" as the USB drive. These are EXAMPLES, you MUST use the proper device names that YOU figured out.

    Code:
    # WARNING - EXAMPLE ONLY - DO NOT EXECUTE
    sudo dd if=/dev/sda of=/dev/sdb
    The line means "super user do dd input file=/dev/sda and output file = /dev/sdb and copy all of it.

    This will copy every byte from your Ubuntu drive to the USB drive. Assuming that your computer supports booting from a USB drive, you should then simply be able to plug in the USB drive and boot into it.

    Please though... be VERY careful that you use the proper device names. If you get it wrong, you could irretrievably wipe out important data.

    Good luck!

    -- Roger
    Gentlemen may prefer Blondes, but Real Men prefer Redheads!

  3. #3
    Join Date
    Oct 2006
    Location
    Canada
    Beans
    39

    Re: Copy Ubuntu Server 8.04 LTS from IDE Hard Drive To USB Drive

    Hi,

    I was playing around with something similar last night. I installed 8.10 to a flash device, and and wanted to copy it to larger drive. I don't know if this will work for hardy or ide, but i used dd..

    Code:
    #sudo dd if=/dev/sdb of=/dev/sdc conv=noerror,sync bs=4k
    /dev/sdb was the orginal drive, /dev/sdc was the new drive.

    i used

    Code:
    #sudo fdisk -l
    to check to see what the drive names where.

    hope this helps,

    pro
    Laptop: Dell 1525 / Ubuntu 11.04
    Media Centre: 11.04 Mythtv/Boxee Firewire
    NAS=AMD Sempron 1800+, 4x1TB Samsung HD, RAID 10, Ubuntu Server 8.10

  4. #4
    Join Date
    Aug 2008
    Beans
    6

    Re: Copy Ubuntu Server 8.04 LTS from IDE Hard Drive To USB Drive

    Thanks for the replies.

    Krupski,

    I know that there will be a size difference between the IDE and USB drives. The IDE drive is 20GB, but only about 2GBs is used. The USB drive is 8GB. How can I resolve the partition issues?

    Prosonik,
    What does conv=noerror,sync bs=4k do?

    Thank you for your help.

  5. #5
    Join Date
    Jun 2007
    Location
    Hikkaduwa, Sri Lanka
    Beans
    3,394
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: Copy Ubuntu Server 8.04 LTS from IDE Hard Drive To USB Drive

    After backing up your data you can use gparted to shrink your server partition down to less than 8G and then clone it using dd.

  6. #6
    Join Date
    Mar 2006
    Location
    Williams Lake
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Copy Ubuntu Server 8.04 LTS from IDE Hard Drive To USB Drive

    You can also use partimage, it works the same way as dd but does not duplicate the empty space. Partimage is available in the repositories.

    Jim

  7. #7
    Join Date
    May 2008
    Location
    my(@HOME, -$NJ)
    Beans
    296
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Copy Ubuntu Server 8.04 LTS from IDE Hard Drive To USB Drive

    here's how I backup all my hard drives, hope it helps out.

    BACKUP YOUR MBR
    You should do this before you edit your partition table so that you can put it back if you mess things up.

    # dd if=/dev/hda of=/root/hda.boot.mbr bs=512 count=1
    If things mess up, you can boot with Knoppix, mount the partition containing /root (hda1 in this example) and put back the MBR with the command:
    # dd if=/mnt/hda1/root/hda.boot.mbr of=/dev/hda bs=512 count=1


    Getting around file size limitations using split

    When making images, it's quite easy to run up against various file size limitations. One way to work around a given file size limitation is to use the split command.

    # dd if=/dev/hda3 | gzip -c | split -b 2000m - /YAGI/backup.img.gz

    Then whenever you need to restore your USB stick to the Gentoo Live image you built, you can run a command like the following:

    To restore the multi-file backup, do the following:
    # cat /mnt/hdc1/backup.img.gz.* | gzip -dc | dd of=/dev/hda3

    1. Cat recombines contents of the compressed and split image files to stdout, in order.
    2. Results are piped through gzip for decompression.
    3. And are then written to the first partition of the hard drive with dd.

  8. #8
    Join Date
    May 2008
    Location
    Terrace, British Columbia
    Beans
    188

    Re: Copy Ubuntu Server 8.04 LTS from IDE Hard Drive To USB Drive

    Some of you guys do things the hard way.
    dd is overkill.

    Create the partition on your usb drive.
    format it:
    mkfs.ext3 /dev/sd*

    Copy your files over

    cp -ax source destination

    Replace UUID in FSTAB and in GRUB

  9. #9
    Join Date
    Oct 2006
    Location
    Canada
    Beans
    39

    Re: Copy Ubuntu Server 8.04 LTS from IDE Hard Drive To USB Drive

    Hi there,

    Here is an article on using DD to restore a crashed drive. The author goes step-by-step to explain each switch he using, including the one i have used.

    http://www.debianadmin.com/recover-d...-using-dd.html

    As with everything, there seems to be multiple paths to the same destination..

    pro


    Quote Originally Posted by wbelk7777 View Post
    Thanks for the replies.

    Prosonik,
    What does conv=noerror,sync bs=4k do?
    Laptop: Dell 1525 / Ubuntu 11.04
    Media Centre: 11.04 Mythtv/Boxee Firewire
    NAS=AMD Sempron 1800+, 4x1TB Samsung HD, RAID 10, Ubuntu Server 8.10

  10. #10
    Join Date
    Oct 2006
    Location
    Canada
    Beans
    39

    Re: Copy Ubuntu Server 8.04 LTS from IDE Hard Drive To USB Drive

    interesting.
    using cp, will you be able to boot from the drive? what about the mbr.

    pro



    Quote Originally Posted by promodus View Post
    Some of you guys do things the hard way.
    dd is overkill.

    Create the partition on your usb drive.
    format it:
    mkfs.ext3 /dev/sd*

    Copy your files over

    cp -ax source destination

    Replace UUID in FSTAB and in GRUB
    Laptop: Dell 1525 / Ubuntu 11.04
    Media Centre: 11.04 Mythtv/Boxee Firewire
    NAS=AMD Sempron 1800+, 4x1TB Samsung HD, RAID 10, Ubuntu Server 8.10

Page 1 of 2 12 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
  •