Cloning for a fresh disk setup?

I’d like to ask about cloning my current setup so that I can wipe Windows and utilize my hard disk more efficiently; I feel like 10GB is squeezing openSUSE just a bit since I’m already up to 70% usage. I’ve got a config that I like and would rather not have to do all that again.

Advice greatly appreciated!

On 2013-01-26 22:36, martylux wrote:
>
> I’d like to ask about cloning my current setup so that I can wipe
> Windows and utilize my hard disk more efficiently; I feel like 10GB is
> squeezing openSUSE just a bit since I’m already up to 70% usage. I’ve
> got a config that I like and would rather not have to do all that again.
>
> Advice greatly appreciated!

Assuming you are using the same disk, and you just remove Windows, you
can simply claim that partition for use by Linux as another partition,
for example for /usr. No need to reinstall.

For more exact recommendations you will have to display your partition
list (fdisk -l) and usage (fstab), and which partitions you can delete.


Cheers / Saludos,

Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)

Although you can do as Carlos suggests and just “claim” your new space with a new and separate partition, it’s my experience that many want to keep using their existing partitions and folders, and don’t want to organize their data on a new partition.

Without listing the many pros and few cons keeping your partitions smaller, if you want to expand your partition I recommend

  • Do a complete and full backup first, using any program or type of backup you wish, can be cloning/imaging, can be file-based, just make sure it’s good.

  • Download and create a bootable CD running Gparted Live. When you boot to that LiveCD, you can extend (enlarge) your partitions into adjacent free space and move your partitions around if you wish… All without destroying the existing data in the partition.

HTH,
TSU

dhcppc0:/home/marty # fdisk -l

Disk /dev/sda: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488397168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x02b7e848


   Device Boot      Start         End      Blocks   Id  System
/dev/sda1        20386485   472008060   225810788    7  HPFS/NTFS/exFAT
/dev/sda2   *        2048    20385791    10191872   83  Linux
/dev/sda3       472008704   476231679     2111488   82  Linux swap / Solaris
/dev/sda4       476231680   488396799     6082560   83  Linux


Partition table entries are not in disk order


Disk /dev/sdg: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000a4a58


   Device Boot      Start         End      Blocks   Id  System
/dev/sdg1   *        2048    65538047    32768000    c  W95 FAT32 (LBA)
/dev/sdg2       483330048   976773119   246721536    7  HPFS/NTFS/exFAT
dhcppc0:/home/marty # 
dhcppc0:/home/marty # cat /etc/fstab
/dev/disk/by-id/ata-WDC_WD2500JS-00NCB1_WD-WCANKD616567-part3 swap                 swap       defaults              0 0
/dev/disk/by-id/ata-WDC_WD2500JS-00NCB1_WD-WCANKD616567-part2 /                    ext4       acl,user_xattr        1 1
/dev/disk/by-id/ata-WDC_WD2500JS-00NCB1_WD-WCANKD616567-part4 /home                ext4       acl,user_xattr        1 2
/dev/disk/by-id/ata-WDC_WD2500JS-00NCB1_WD-WCANKD616567-part1 /windows/C           ntfs-3g    users,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8 0 0
proc                 /proc                proc       defaults              0 0
sysfs                /sys                 sysfs      noauto                0 0
debugfs              /sys/kernel/debug    debugfs    noauto                0 0
devpts               /dev/pts             devpts     mode=0620,gid=5       0 0
dhcppc0:/home/marty # 
dhcppc0:/home/marty # df
Filesystem     1K-blocks     Used Available Use% Mounted on
rootfs          10031744  6649480   2872672  70% /
devtmpfs         1014308       36   1014272   1% /dev
tmpfs            1022304     1752   1020552   1% /dev/shm
tmpfs            1022304      676   1021628   1% /run
/dev/sda2       10031744  6649480   2872672  70% /
tmpfs            1022304        0   1022304   0% /sys/fs/cgroup
tmpfs            1022304      676   1021628   1% /var/run
tmpfs            1022304      676   1021628   1% /var/lock
tmpfs            1022304        0   1022304   0% /media
/dev/sda4        5986992  1228988   4453876  22% /home
/dev/sda1      225810784 81199516 144611268  36% /windows/C
/dev/sdg2      246721532 17051384 229670148   7% /media/NTFS
dhcppc0:/home/marty # 
dhcppc0:/home/marty # free
             total       used       free     shared    buffers     cached
Mem:       2044608    1920012     124596          0      57008    1051164
-/+ buffers/cache:     811840    1232768
Swap:      2111484      16760    2094724



What I’d like to do is wipe the 250G hdd. This is a Gateway PC that has the system restore disk that creates the rescue partition. If I fdisk and start over creating partitions for my Linux first (root, swap, and user); maybe 20G, 5G and 20G respectively and then an NTFS partition of 100-150GB for Windows and the remainder as a storage partition. I have an outboard 500G usb hdd that I can use for moving/cloning etc. I would simply resize but the root partition limited because the first 10G stops where the Windows blocks begin so it wouldn’t be contiguous. Does that matter? Will the restore disk even let me do this or does it just fdisk and start all over by default?

Advise please…

You could do it in 3 steps

1 reduce size of sda1 (the windows partition)
2 move sda2 (Linux root) to new end of sda1
3 increase size of sda2 to fill free space to sda3

Note your home partition does not look any too big if you need to increase that just use the above idea to resize move resize as needed

PS
I’d use Windows to resize Windows partitions

Thanks, so do I use Gparted to move sda2? Does that not affect the boot process? Do I need to boot to an ‘external’ OS to move sda2? I can boot to a USB Puppy stick to use Gparted if that’s what’s required.
Thanks again.

I’d like to ask about cloning my current setup so that I can wipe Windows and utilize my hard disk more efficiently;

Clonezilla Clonezilla - Live Doc is one example, this and other cloning tools are on the Partedmagic liveCD downloads – Parted Magic as is Gparted, which can be used to move/resize your LInux partitions after cloning, and the deletion of windows.

Please inform me, I really don’t want to mess this up! I’ve shrink the Win partition; I’m ready to move the root partition. Do I boot from USB to run a partition editor and then create a new partition in the empty space? Then how do I move the root partition to it’s new location?

Also, how best to do a backup in case of failure?

Whether you delete the windows partition or resize it, you could

  1. boot from a liveCD run gparted.
  2. Resize/move sda2 to use the size you want (or delete windows and create a new sda1 as the extended with sda5, sda6 etc, at the start of the disk to the size you want to be used with Linux and resize sda2 to suit)
  3. move sda3
    4.resize sda4 to use the remaining space.

so do I use Gparted to move sda2?

yes.

Does that not affect the boot process?

If the bootloader needs repair or reinstalling we can show you how, just moving the root partition does not usually,

Do I need to boot to an ‘external’ OS to move sda2?

yes.

I highly recommend the cloning of the partitions or the complete disk, as you first asked about before attempting this.
Gparted also has a simple partition copy/paste function GParted – GParted Manual

Please inform me, I really don’t want to mess this up! I’ve shrink the Win partition; I’m ready to move the root partition. Do I boot from USB to run a partition editor and then create a new partition in the empty space? Then how do I move the root partition to it’s new location?

Also, how best to do a backup in case of failure?

I saw this after posting my last post, I think I have replied to most of what you ask above, just ignore the references to the options when deleting the windows partition as you have chosen to resize it.

Then how do I move the root partition to it’s new location?

This info is in the link to the manual posted earlier, there is a basic tutorial here Modify Your Partitions With GParted Without Losing Data | HowtoForge - Linux Howtos and Tutorials

Ok I’m back and it’s broken exactly as I suspected it would be. I’m running Puppy on sda3 (fresh install). I did manage to get Clonezilla to write my partitions back but I had to alter the file names as the partition number had changed. So now when I booted to my suse partition through grub it stops for a couple minutes when trying to initiate the swap file then displays "warning: using problematic uid=0 and gid!=0 then it dumps me to the console command prompt. I can see all my stuff when I browse from Puppy so I know you all can help me fix this. Right?

You had better start by showing us

fdisk -l

and explaining exactly what you did.

The description of your current situation does not line up with having followed the advice given on this thread.

linux:/home/linux # fdisk -l

Disk /dev/sda: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488397168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x02b7e848

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1        20386485   365606260   172609888    7  HPFS/NTFS/exFAT
/dev/sda2       365606912   488396799    61394944    5  Extended
/dev/sda3   *        2048    20385791    10191872   83  Linux
/dev/sda5       365608960   418854911    26622976   83  Linux
/dev/sda6       418856960   434767871     7955456   82  Linux swap / Solaris
/dev/sda7       434769920   488396799    26813440   83  Linux

Partition table entries are not in disk order
linux:/home/linux # 


I would be surprised if anyone could follow two or three mutually exclusive sets of direction but in any case this is where things stand now.
I cloned then partitioned then restored.
Like I said, all my stuff is still there and the boot gets pretty far along so I optimistic!

Also, is there any recovery mode that can be accessed from the CD?

So on booting it hangs right after the message “read swap header failed.” I’m thinking this is related to fstab?

Problem solved; the fstab still pointed to the old partition settings.
Yea me! :smiley:

Thanks for the help and advice…

On 01/26/2013 10:53 PM, Carlos E. R. wrote:
> For more exact recommendations you will have to display your partition
> list (fdisk -l) and usage (fstab), and which partitions you can delete.

careful! he was asked to do this in his other active thread, and
therefore has trouble following directions

see
http://forums.opensuse.org/english/get-technical-help-here/install-boot-login/482732-garbled-screen-after-switching-user-2.html#post2522318

or

Message-ID: <jdmcdaniel3.5psmso@no-mx.forums.opensuse.org>
Newsgroups: opensuse.org.help.install-boot-login
Date: Sat, 26 Jan 2013 21:16:03 GMT
Subject: Re: Garbled screen after switching user


dd

> For more exact recommendations you will have to display your partition
> list (fdisk -l) and usage (fstab), and which partitions you can delete.

careful! he was asked to do this in his other active thread, and
therefore has trouble following directions
I was asked and did so: https://forums.opensuse.org/english/get-technical-help-here/install-boot-login/482732-garbled-screen-after-switching-user.html#post2522278 So do you bother reading the posts or do you just troll around looking for someone to snark at? I’ve been polite and grateful for the help and advice while still hoping to use the experience of others to help me learn more about Linux in general and this OS in particular. After your “simpleton” crack regarding SUSE paste I just laughed it off. SUSE Paste
At this point I suggest you come to grips with whatever it is in your fragile ego that is causing you to have a “have a bad hair day.” …or life.

On Sun, 27 Jan 2013 14:16:08 +0000, martylux wrote:

>> > For more exact recommendations you will have to display your
>> > partition list (fdisk -l) and usage (fstab), and which partitions you
>> > can
>> delete.
>>
>> careful! he was asked to do this in his other active thread, and
>> therefore has trouble following directions I was asked and did so:
>> http://tinyurl.com/adkxkqz So do you bother
> reading the posts or do you just troll around looking for someone to
> snark at? I’ve been polite and grateful for the help and advice while
> still hoping to use the experience of others to help me learn more about
> Linux in general and this OS in particular. After your “simpleton” crack
> regarding SUSE paste I just laughed it off. ‘SUSE Paste’
> (http://susepaste.org/66778028)
> At this point I suggest you come to grips with whatever it is in your
> fragile ego that is causing you to have a “have a bad hair day.” …or
> life.

OK, everyone, that’s enough - let’s stop with the personal attacks and
focus on the issue.

Thanks

Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

I should have read this post more carefully, as it explains what you did and why you did it.

To reply to this post and explain how this could have been achieved using Gparted (yes, I know this is far to late).

creating partitions for my Linux first (root, swap, and user);

I assume you meant root ( / ), /swap and /home.

I would simply resize but the root partition limited because the first 10G stops where the Windows blocks begin so it wouldn’t be contiguous.

After resizing the windows (sda1) partition to give the free space desired you would move that partition using Gparted to the right by the amount required, giving free space on either side of sda1, then resize your Linux root (sda2) to use the free space now available to it.

creating partitions for my Linux first (root, swap, and user); maybe 20G, 5G and 20G respectively and then an NTFS partition of 100-150GB for Windows and the remainder as a storage partition.

Because you already had 4 standard primary partitions one would have had to go, the logical choice would have been swap (sda3), so that would have been deleted and recreated as an extended primary. The swap, NTFS and storage partitions would have been created as logical partitions inside the extended (sda3)

Note that doing it this way you would still have needed to edit fstab, and although I have made changes like this many times and not had a problem with data loss, cloning the partitions is highly recommended before making changes to this extent.

The method you used is good, as long as you were totally confident your cloned images were good.

Problem solved; the fstab still pointed to the old partition settings.
Yea me! :smiley:

Thanks for the help and advice…

I am very pleased to see that even with the misunderstandings you got the result you were looking for.