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

Thread: Create Disk Image for 12.04 Server

  1. #1
    Join Date
    Oct 2007
    Location
    wisconsin, USA
    Beans
    78

    Create Disk Image for 12.04 Server

    O.K., I did a thorough search for this on this forum and on google and could not come up with anything that fits regarding Ubuntu's latest server characteristics (mostly ext4 fs type).

    I also scanned the official 12.04 server documentation and couldn't find much there.

    So, here is the simple question:
    What is the best practice for creating a full disk image for a Ubuntu 12.04 Server?

    More Verbose:

    I tried following:
    https://help.ubuntu.com/community/DriveImaging

    However, the problem is that the recommended partimage does not support the default fs type (ext4) which appears to be the default fs type installed for Ubuntu 12.04. So, though partimage does have some great features, like not including free space when copying, it does not appear to be the best option.

    Other Options:
    'dd' is also mentioned, but I am more used to the vmware methods of making a snapshot, and dd appears complicated. If dd *is* the recommended method, I'd sure like to get some help, and even maybe we can come up with a community HowTo to use it.

    Clonezilla is another resource, but its limitations are not that enticing in my opinion. In other words, you are required to have a drive of equal or greater size of the partition you are making an image of (to store your image). I don't actually have that resource at the moment.

    At the end of the 12.04 docs regarding backups, it mentions:

    "rsnapshot: a file system snapshot utility used to create copies of an entire file system."


    This looks to be a perl based rsync solution, so I'm not sure it actually creates a bit by bit snapshot as defined. The project website is here. It would be interesting for those who know more about this to comment.

    Summary:
    Ideally, I'd like to find a solution that is spelled out clearly, as I'm sure many of us Ubuntu Server operators would as well. Maybe it's already out there, and I am over-thinking this. Hopefully someone can point that out if that is the case. However, using VMWare on my mac, I just press a 'Create Snapshot' button and it just works. I don't expect that, but it would be nice to have something clear to work with for creating snapshots.

    Donovan

  2. #2
    Join Date
    May 2008
    Beans
    38

    Re: Create Disk Image for 12.04 Server

    i don't know but you could try clonezilla

  3. #3
    Join Date
    Jun 2010
    Location
    Cornwall, UK
    Beans
    112
    Distro
    Ubuntu

    Re: Create Disk Image for 12.04 Server

    You might want to look into rsync
    WARNING: You are logged into reality as 'root'... logging in as 'insane' is the only safe option.
    Linux in the UK
    The Linux Community Forum

  4. #4
    Join Date
    Nov 2009
    Location
    Segur De Calafell, Spain
    Beans
    11,660
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Create Disk Image for 12.04 Server

    If you are looking for offline backup, you can also consider FS Archiver.
    http://www.fsarchiver.org/Main_Page

    If I am not mistaken clonezilla is also offline, you need to boot with the clonezilla cd. But with clonezilla the restore partition has to be same or greater than the source partition regardless of the amount of data actually on it.

    FS Archiver can restore on a smaller partition than the original as long as the data fits.

    It is included on the System Rescue CD, so you can boot the server with it and run it.

    After the restore I think you will need to edit /etc/fstab to change the UUID of the new partition, and reinstall grub2 on the MBR of the disk.
    Darko.
    -----------------------------------------------------------------------
    Ubuntu 12.04 LTS 64bit & Windows 7 Ultimate 64bit

  5. #5
    Join Date
    Oct 2007
    Location
    wisconsin, USA
    Beans
    78

    Re: Create Disk Image for 12.04 Server

    Quote Originally Posted by Gompa View Post
    i don't know but you could try clonezilla
    Gompa, please read my original through.

    Thx,
    Donovan

  6. #6
    Join Date
    Oct 2007
    Location
    wisconsin, USA
    Beans
    78

    Re: Create Disk Image for 12.04 Server

    Quote Originally Posted by PCNetSpec View Post
    You might want to look into rsync
    I love rsync, but I don't believe it's suited for snapshot creation. It's better at backups and backing up 'differences'.

    Donovan

  7. #7
    Join Date
    Oct 2007
    Location
    wisconsin, USA
    Beans
    78

    Re: Create Disk Image for 12.04 Server

    Quote Originally Posted by darkod View Post
    If you are looking for offline backup, you can also consider FS Archiver.
    http://www.fsarchiver.org/Main_Page

    If I am not mistaken clonezilla is also offline, you need to boot with the clonezilla cd. But with clonezilla the restore partition has to be same or greater than the source partition regardless of the amount of data actually on it.

    FS Archiver can restore on a smaller partition than the original as long as the data fits.

    It is included on the System Rescue CD, so you can boot the server with it and run it.

    After the restore I think you will need to edit /etc/fstab to change the UUID of the new partition, and reinstall grub2 on the MBR of the disk.
    Darkod, thanks for pointing out FS Archiver. It's not what I had in mind (It doesn't create an 'image' in the traditional sense), but it looks like a possible solution for my needs anyway.

    Anyway, ..would like to hear more comments/ideas if they are out there.

    Thx all!,

    Donovan

  8. #8
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Create Disk Image for 12.04 Server

    Quote Originally Posted by dbrooke View Post
    Gompa, please read my original through.

    Thx,
    Donovan
    I used to use PING (PartImage is not Ghost), but hit a brick wall with it when I wanted to clone an ext4 partition. I've used Clonezilla every since.

    They have very good documentation too.

    However, if you are looking to take snapshots of the drive, why not just use LVM snapshots?

    http://tldp.org/HOWTO/LVM-HOWTO/snapshotintro.html
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  9. #9
    Join Date
    May 2008
    Beans
    38

    Re: Create Disk Image for 12.04 Server

    oh srry i some how totally missed that

  10. #10
    Join Date
    Oct 2007
    Location
    wisconsin, USA
    Beans
    78

    Re: Create Disk Image for 12.04 Server

    Quote Originally Posted by CharlesA View Post
    -snip-I've used Clonezilla every since.
    I'd try it out, but I just don't have the backup space right now to utilize for this particular backup.

    Quote Originally Posted by CharlesA View Post

    However, if you are looking to take snapshots of the drive, why not just use LVM snapshots?

    http://tldp.org/HOWTO/LVM-HOWTO/snapshotintro.html
    I ran into this just before I saw your post.. was looking at:
    http://www.sysresccd.org/Sysresccd-L...n_LVM_snapshot

    Alright, I'm going to try this but I'm not happy about it.

    It appears I have to do a few things to make this work.

    First, here is a look at my drives:
    Code:
    root@edc-webhost1:/var/www# fsarchiver probe simple
    [======DISK======] [=============NAME==============] [====SIZE====] [MAJ] [MIN]
    [sda             ] [ST3500630AS                    ] [   465.76 GB] [  8] [  0]
    [sr0             ] [DVD-RW GSA-H60L                ] [   378.96 MB] [ 11] [  0]
    
    [=====DEVICE=====] [==FILESYS==] [======LABEL======] [====SIZE====] [MAJ] [MIN] 
    [sda1            ] [ext2       ] [<unknown>        ] [   243.00 MB] [  8] [  1] 
    [sda5            ] [LVM2_member] [<unknown>        ] [   465.52 GB] [  8] [  5] 
    [dm-0            ] [ext4       ] [<unknown>        ] [   463.04 GB] [252] [  0] 
    [dm-1            ] [swap       ] [<unknown>        ] [     2.43 GB] [252] [  1]
    As shown, I chose the LVM option when setting up Server 12.04 and told it to make 1 partition that spanned the entire drive.

    Of what I'm reading, this is probably not the best thing to do when utilizing LVM, because it's easier to size up, than size down.

    So, why do I have to size down? Well, If I'm going to make an LVM snapshot, I will need enough room in my Volume Group to create the snapshot "logical-volume".

    For those that care to understand.. .. some of the benefits of creating an LVM snapshot are:
    1. You are creating a frozen data set that can easily be reverted back to. (this may be pertinent for pre-upgrade integrity or pre-application install integrity, especially in a production situation).

    2. Once a snapshot is created, you don't have to stop the server to get an uninterrupted backup of the snapshot volume (using rsync, fsarchiver, etc..)


    So, to elaborate further, I guess the basic steps are:
    1. size down my single logical volume to make room for the new "snapshot" volume.

    2. Create the LVM snapshot.. below contains some info that I guess I'll have to use to create it... looks like I could create the swap partition snapshot as well???

    Code:
      --- Logical volume ---
      LV Name                /dev/edc-webhost1/root
      VG Name                edc-webhost1
      LV UUID                1RvKOS-f3rw-8nw8-eU6H-zOPn-tEeb-CKa6pH
      LV Write Access        read/write
      LV Status              available
      # open                 1
      LV Size                463.04 GiB
      Current LE             118538
      Segments               1
      Allocation             inherit
      Read ahead sectors     auto
      - currently set to     256
      Block device           252:0
       
      --- Logical volume ---
      LV Name                /dev/edc-webhost1/swap_1
      VG Name                edc-webhost1
      LV UUID                sTV2j4-1ScO-2eFY-rKlA-U94j-vTg4-JXeHMe
      LV Write Access        read/write
      LV Status              available
      # open                 2
      LV Size                2.43 GiB
      Current LE             623
      Segments               1
      Allocation             inherit
      Read ahead sectors     auto
      - currently set to     256
      Block device           252:1
    3. Mount the new snapshot, in order to attain a clean backup.

    4. Make a backup using fsarchiver or rsync to my mounted external firewire drive.

    Ultimately, I may just use the script they have listed at:http://www.sysresccd.org/Sysresccd-L...n_LVM_snapshot

    Wish me luck!

    Donovan

Page 1 of 2 12 LastLast

Tags for this Thread

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
  •