openSUSE 11.1 -> how to move / to new disk?

Hello,
I am using openSUSE 11.1.
I recently installed an additional hard drive since running out of space.
New drive up and running, used Yast Partitioner successfully.

2 questions as follows:

  1. New drive still has Windows XP on one of its partitions…
    Can I easily implement/set up for dual boot?
  2. More importantly, I need to move root ("/") of file system to new drive “sdb”
    since more space available but not certain correct way to do this

Below are listings I think are relevant:

% df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda6 7344896 6573552 398236 95% /
udev 252776 200 252576 1% /dev
/dev/sda7 10736660 297404 9893852 3% /home
/dev/sdb6 69972 5407 60952 9% /store0
/dev/sdb7 11693588 557608 10541980 6% /store1
/dev/sdb8 17504716 176196 16439324 2% /store2
/dev/sr0 4451058 4451058 0 100% /media/SU1110.001

% fdisk -l

Disk /dev/sda: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xfd478bc7

Device Boot Start End Blocks Id System
/dev/sda3 * 2516 4865 18876375 f W95 Ext’d (LBA)
/dev/sda5 2516 2578 506016 82 Linux swap / Solaris
/dev/sda6 2579 3507 7462161 83 Linux
/dev/sda7 3508 4865 10908103+ 83 Linux

Disk /dev/sdb: 30.7 GB, 30735581184 bytes
255 heads, 63 sectors/track, 3736 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0000c9b0

Device Boot Start End Blocks Id System
/dev/sdb1 1 25 200781 83 Linux
/dev/sdb2 * 26 3736 29808607+ f W95 Ext’d (LBA)
/dev/sdb5 26 34 72261 83 Linux
/dev/sdb6 35 43 72261 83 Linux
/dev/sdb7 44 1522 11880036 83 Linux
/dev/sdb8 1523 3736 17783923+ 83 Linux

% cat /etc/fstab

/dev/disk/by-id/ata-IC35L040AVER07-0_SXPTX3S1085-part5 swap swap defaults 0 0
/dev/disk/by-id/ata-IC35L040AVER07-0_SXPTX3S1085-part6 / ext3 acl,user_xattr 1 1
/dev/disk/by-id/ata-IC35L040AVER07-0_SXPTX3S1085-part7 /home ext3 acl,user_xattr 1 2
proc /proc proc defaults 0 0
sysfs /sys sysfs noauto 0 0
debugfs /sys/kernel/debug debugfs noauto 0 0
usbfs /proc/bus/usb usbfs noauto 0 0
devpts /dev/pts devpts mode=0620,gid=5 0 0
/dev/disk/by-id/ata-Maxtor_93073U6_G604383C-part6 /store0 ext3 acl,user_xattr 1 2
/dev/disk/by-id/ata-Maxtor_93073U6_G604383C-part7 /store1 ext3 acl,user_xattr 1 2
/dev/disk/by-id/ata-Maxtor_93073U6_G604383C-part8 /store2 ext3 acl,user_xattr 1 2

Any suggestions/recommendations appreciated…thanks.

Did you add a 40GB drive? That’s not a very long term solution, in my opinion, but that’s not for me to question.

Have you considered just moving your /home partition to the new drive and then expanding your root partition on the old drive? That may be the least work. You may not even have to expand your root partition and perhaps use your old /home for /etc or /var, etc. Which of the system folders is getting too big?

And, PLEASE PLEASE do not do anything without a FULL system backup, especially for your /home partition.

Yes, I had an old HP computer with old 40 GB drive…so I simply removed the old 40 GB drive, moved the jumpers to make it a slave drive, and installed it in the current system. Agreed not a great solution but one “easily at hand for now”.

Your basic suggestions sound reasonable. I will do complete full system backup to a removable USB drive.
Then if you could suggest basic steps for:

  1. moving my /home partition to new drive
  2. expanding my root partition on old drive
    I would be grateful.
    I am now reading through “SDB Basics of partitions, file systems, mount points” from openSUSE Forum…so
    I have a reasonably good understanding of most basic operations, steps, tools, etc.
    But anything tricky or important things to watch out for…would be appreciated.
    I assume, based on this forum, as root I am going to:
    i) mv /home /old_home
    ii) mkdir /home on new disk (not sure how to be certain this will be on new disk…)
    iii) cp -ra /old_home /home
    iv) modify /etc/fstab to load /home on new disk
    v) reboot and verify

As far as expanding my root partition on old drive, I am guessing I would use Yast Partitioner, select that parition and resize…yes? Anything to watch out for
or be aware of before or after doing this?

Thanks again and any comments/suggestions appreciated…
I will go work on complete backup to USB removable drive and wait for your reply before taking any further action.

Which post/wiki did you use for “moving /home partition”? Your step iii) doesn’t look right to me: you will want to preserve the permissions, so I think you need to use a variant of the “-p” option. I recommend that you research that some more on the wikis or Google - I’ve never done a /home move myself. Perhaps someone else can chime in here.

As I was looking back at your fdisk listing, I noticed just now that sda1, sda2, sda3 and sda4 are missing. That is bizarre. Do you have any idea why that is? This may mess up partition resizing, so I recommend you figure out why that is before resizing.

I have no experience resizing with Yast Partitioner, so I cannot comment on that. The tool I’ve used in the past is Parted Magic. This is a LiveCD you boot from and this will let you resize partitions. Keep in mind that resizing partitions will take a LONG time and can lead to complete data loss on the entire drive, so make sure you have ALL the data on the ENTIRE drive backed up!

On 2010-07-17 23:06 GMT twelveeighty wrote:

> As I was looking back at your fdisk listing, I noticed just now that
> sda1, sda2, sda3 and sda4 are missing. That is bizarre. Do you have
> any idea why that is? This may mess up partition resizing, so I
> recommend you figure out why that is before resizing.

I think they are missing from “df” output because they are not mounted.
And sda1,2 and 4 are missing from fdisk because, I guess, they don’t
exist. Weird, but not impossible.

Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” GM (Minas Tirith))

On 2010-07-17 20:56 GMT bgw1234 wrote:

>
> Your basic suggestions sound reasonable. I will do complete full
> system backup to a removable USB drive.

There is a howto on the LDP about this. And there is an RPM for all the
howtos that you can install, in the oss repo. Upgrading hardisk, I
think it is named.

> I assume, based on this forum, as root I am going to:
> i) mv /home /old_home
> ii) mkdir /home on new disk (not sure how to be certain this will be
> on new disk…)

Actually, there will be an empty directory in the partition that is
“/”, in the old disk, and the partition of the new disk will be mounted
on that.

> iii) cp -ra /old_home /home

My preferred tools for this are “mc” and “rsync”.

> iv) modify /etc/fstab to load /home on new disk
> v) reboot and verify

Actually, don’t reboot :slight_smile:

>
> As far as expanding my root partition on old drive, I am guessing I
> would use Yast Partitioner, select that parition and resize…yes?

Or reclaim as /usr or /usr/share.


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” GM (Minas Tirith))

Yes, I agree - if the OP can reclaim that partition instead of “merging” two partitions, I would highly recommend that as well. With du, check out the usage of the /usr folder and see if that would fit on the current /home partition.