Results 1 to 10 of 10

Thread: How do you properly clone OpenSuSE box

  1. #1

    Default How do you properly clone OpenSuSE box

    I am using System Rescue CD for cloning. I've been cloning Windows for some years and recently started to clone OpenSuSE 12.3. I can clone on the exact same box (where original image was created) w/o problem. I am also familiar with copying dos mbr + partition table.

    But when I clone to identical hardware, I got the following problems.

    1. I have 3 partitions of type ext3: /, swap, /home. I can restore to / and don't need to restore swap. When I restore /home, OpenSuSE went to emergency mode after reboot. It asked me to look at output of 'journalctl -b' and here is the output:

    ....lots of lines here, I don't think they are errors....
    ....the following 4 lines are highlighted in red....
    Timed out waiting for device dev-disk-by-id\x2did-ata\x2dWDC_WD800BB\x2d00JHC0_WD\x2dWMAM9DEH1322
    Dependency failed for /home
    Dependency failed for Local File Systems
    Dependency failed for Remote File Systems (Pre)

    2. I thought different hard disks are identified by different id. I found that though hard drives are identical (WD800BB + JHC0 whatever this is), serial numbers (i.e WMAM9DEH1322 above is serial num) are different. I saw fstab used the serial number:
    /dev/disk/by-id/ata-WDC_WD800BB-00JHC0_WD_<serial number here>_part<x> <mount point> ...

    3. Like I said, it can restore root partition but only when it tried to mount /home, it failed. So I booted the clone box using sysresccd and looked around, I found that /dev contains almost nothing. Normally, /dev will contains lots of files.

    Based on my experience with Windows, Windows will regenerate necessary files and ids (i.e SID's) if I use proper tools (SysPrep) and steps. How can I do the same for the Linux? Or am I following the wrong lead?

    How do you solve this problem? More importantly, what is the proper way to clone OpenSuSE? Due to my requirement, I have to make /home as separate partition.

    Thank you much!

  2. #2

    Default Re: How do you properly clone OpenSuSE box

    > 2. I thought different hard disks are identified by different id. I
    > found that though hard drives are identical (WD800BB + JHC0 whatever
    > this is), serial numbers (i.e WMAM9DEH1322 above is serial num) are
    > different. I saw fstab used the serial number:
    > /dev/disk/by-id/ata-WDC_WD800BB-00JHC0_WD_<serial number here>_part<x>
    > <mount point> ...


    The by-id stuff does not work well with cloning, but that's something you
    do not need to use. Modify /etc/fstab to instead mount by the regular
    names you're used to (/dev/sda1, etc.) and this should be okay.


    > Based on my experience with Windows, Windows will regenerate necessary
    > files and ids (i.e SID's) if I use proper tools (SysPrep) and steps.
    > How can I do the same for the Linux? Or am I following the wrong lead?


    Linux and windows are not the same thing, and what you're doing now is not
    even close to what sysprep does. A closer technology, and a better one to
    use for openSUSE, is AutoYast. You can create an AutoYast config file and
    then use that to build subsequent systems. This has a lot of advantages,
    such as it's much easier to customize than your bit-by-bit clone , and it
    will also work with slight differences in hardware (where your current one
    may not). Further, it's something that can be future-proof'd with
    patches, so you do not install years-old **** with every clone simply
    because that is what you cloned originally. Next, it can be much faster,
    since many systems using a common config can install from software
    repositories at the same time, and those installs do not necessarily need
    to have your master clone passed out to their site first, so installing to
    a system out in the middle of nowhere can work without copying 20 GB of
    stuff first.

    With that said, you'll need to get the AutoYast config created. Yast can
    help you do this, or if you just installed a new system the last screen
    lets you clone the system and create an AutoYast file, which is how I'd
    recommend starting things.

    --
    Good luck.

    If you find this post helpful and are logged into the web interface,
    show your appreciation and click on the star below...

  3. #3
    Join Date
    Nov 2009
    Location
    West Virginia Sector 13
    Posts
    16,286

    Default Re: How do you properly clone OpenSuSE box

    In Linux all things are files so there are directories that are only filled with device or kernel process. These are virtual file systems and do not live on a disk only on a running system. This is not Windows.

    If you are planing on cloning using partitions labels are a good way. but you must assure that there are never duplicate label names used on a running system.

  4. #4
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: How do you properly clone OpenSuSE box

    On 2014-02-17 01:49, ab wrote:

    > Modify /etc/fstab to instead mount by the regular
    > names you're used to (/dev/sda1, etc.) and this should be okay.


    No, no, those devices names should not be used. They are not guaranteed
    to remain the same across boots.

    --
    Cheers / Saludos,

    Carlos E. R.

    (from 13.1 x86_64 "Bottle" (Minas Tirith))

  5. #5
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: How do you properly clone OpenSuSE box

    On 2014-02-17 01:16, nexz wrote:


    > 2. I thought different hard disks are identified by different id. I
    > found that though hard drives are identical (WD800BB + JHC0 whatever
    > this is), serial numbers (i.e WMAM9DEH1322 above is serial num) are
    > different. I saw fstab used the serial number:
    > /dev/disk/by-id/ata-WDC_WD800BB-00JHC0_WD_<serial number here>_part<x>
    > <mount point> ...


    You can mount partitions using id, uuid, label, or path. Labels and ids
    are cloned, but uuid and path depend on the target disk. It is up to you
    to choose a method that can be cloned, or to edit fstab when cloning.

    Also, grub can be a problem when cloning it.


    > looked around, I found that /dev contains almost nothing. Normally, /dev
    > will contains lots of files.


    That is correct, "/dev" should be empty. It is "automatically" filled
    when the system is running.


    --
    Cheers / Saludos,

    Carlos E. R.

    (from 13.1 x86_64 "Bottle" (Minas Tirith))

  6. #6

    Default Re: How do you properly clone OpenSuSE box

    it will be better to cloning to an external support, imho

    try Clonezilla, works very well, you can clone partitions or the entire hdd or ssd

  7. #7

    Default Re: How do you properly clone OpenSuSE box

    Quote Originally Posted by ab View Post
    >
    The by-id stuff does not work well with cloning, but that's something you
    do not need to use. Modify /etc/fstab to instead mount by the regular
    names you're used to (/dev/sda1, etc.) and this should be okay.

    A closer technology, and a better one to
    use for openSUSE, is AutoYast. You can create an AutoYast config file and
    then use that to build subsequent systems.
    Thanks. I did exactly that. I did these:
    1. Edit /etc/fstab to have device names, i.e /dev/sda1, etc.
    2. In /etc/default/grub, edit GRUB_CMDLINE_LINUX_DEFAULT to use device name instead of by-id thing
    3. Ran grub2-mkconfig

    Reboot it and things seem to be fine. Do I need anything else?

    I'll keep AutoYaST in mind but I don't want it for this. I am gonna even disable auto update on these boxes. If things change, I'll create another image.

    Quote Originally Posted by robin_listas View Post
    On 2014-02-17 01:49, ab wrote:

    > Modify /etc/fstab to instead mount by the regular
    > names you're used to (/dev/sda1, etc.) and this should be okay.


    No, no, those devices names should not be used. They are not guaranteed
    to remain the same across boots.
    Thanks!

    I only have 1 hard drive and 2 usable partitions in it. Other boxes will have the same config. If not device names, what are you suggesting? Using by-id doesn't fly across boxes. Uuid seem long and not intuitive to identify partitions. What do you mean by label? By path, I am guessing the one I just used, /dev/sda1.

    Quote Originally Posted by robin_listas View Post

    You can mount partitions using id, uuid, label, or path. Labels and ids
    are cloned, but uuid and path depend on the target disk. It is up to you
    to choose a method that can be cloned, or to edit fstab when cloning.

    Also, grub can be a problem when cloning it.
    I guess I updated the grub by running commands above. What else do you see related to grub problem?

  8. #8

    Talking Re: How do you properly clone OpenSuSE box

    Happy Camper here! I just re-image identical box and everything works fine. Thanks for your support!

  9. #9
    Join Date
    Sep 2012
    Posts
    7,096

    Default Re: How do you properly clone OpenSuSE box

    Quote Originally Posted by nexz View Post
    What else do you see related to grub problem?
    You need to adjust /etc/default/grub_installdevice, this is where YaST stores location of bootloader and this file is used by openSUSE tools when grub2 needs update (e.g. during RPM install).

  10. #10
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: How do you properly clone OpenSuSE box

    On 2014-02-17 08:46, nexz wrote:

    > Thanks. I did exactly that. I did these:
    > 1. Edit /etc/fstab to have device names, i.e /dev/sda1, etc.


    You should not use devices names such as sda. They are not persistent.


    > I only have 1 hard drive and 2 usable partitions in it. Other boxes will
    > have the same config. If not device names, what are you suggesting?


    For instance, labels. That's what I use.

    > Using by-id doesn't fly across boxes. Uuid seem long and not intuitive
    > to identify partitions.


    Right, I confused uuids and ids. Yes, uuid are not intuitive,
    absolutely, but they are cloned and automatically regenerated by mkfs.
    So they work with cloning.

    > What do you mean by label? By path, I am
    > guessing the one I just used, /dev/sda1.


    No, that's device name.

    Have a look at the directory:

    Code:
    minas-tirith:~ # ls /dev/disk/
    by-id  by-label  by-path  by-uuid
    minas-tirith:~ #

    They contain symlinks to the actual devices, and are persistent. You can
    use any of them (only label and uuid are cloned).

    Sample usages in fstab:

    Code:
    
    > LABEL=Swap      swap    swap            defaults                        0 0
    > LABEL=Boot      /boot   ext2            acl,user_xattr                  1 2
    > LABEL=Root      /       ext4            acl,user_xattr                  1 1
    
    > UUID="D89260D89260BD1E"       /windows/C      ntfs-3g user,users,gid=users,fmask=0117,dmask=0007,locale=en_US.UTF-8           0 0
    
    > /dev/disk/by-id/ata-ST9500325AS_5VE68QJX-part1  /windows/system         ntfs-3g ro,noauto,users,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8        0 0

    To use labels, you need to assign them to each partition, of course. You
    can do that when creating them, with yast partitioner, or with separate
    CLI tools like e2label.


    >> Also, grub can be a problem when cloning it.
    >>

    >
    > I guess I updated the grub by running commands above. What else do you
    > see related to grub problem?


    If it boots, nothing :-)


    Notice that tools like clonezilla do not clone grub: they reinstall it.


    --
    Cheers / Saludos,

    Carlos E. R.

    (from 13.1 x86_64 "Bottle" (Minas Tirith))

Tags for this Thread

Posting Permissions

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