Increase "/" root partition

I am looking for a process where I can move a Suse Enterprise VM guest system built on a 3390 mod-9 to a 3390 mod-18 and preserve the existing data. An easy example would be with the 3390 mod-9 with one (1) partition defined for the “/” root. I believe I can DDR the 3390 mod-9 to the 3390 mod-18 but the partition table would inherit the 3390 mod-9 characteristics. Is is possible to update the partition table without losing the system? Is there any reliable method to back up the data from a 3390 mod-9 and restore it to a 3390 mod-18 where the system would recognize all the available space?

Disclaimer: I have no idea what 3390, ‘mod-9’, or ‘mod-18’ mean, and I’m
too lazy to Google for the answer there.

You can usually use Yast to expand things, especially if you setup your
system with Logical Volume Management (LVM) from the start, and if you did
use LVM you can possibly even do it online vs. while booting from external
media. Without LVM, a lot of “ifs” and “buts” come into play. For example:

If the root of the filesystem is /dev/sda1, and /dev/sda2 is swap, and the
two partitions are next to eachother, there is nowhere for you to grow
/dev/sda1. Insert sad face here. Of course, you could delete /dev/sda2
and use that space to expand /dev/sda1, then expand the filesystem (XFS,
BtrFS, etc.) within the partition, but now you’re lacking a swap partition
(not usually terrible, but something to note at least), and that should
only really net you a couple of GiBs, and you probably want more than that.

What you may find to be easiest, or at least possible, is booting from
external media with another disk in the system (physical or virtual, which
is why I’m including this option, as it should work for just about anybody
with hardware (virtual or physical) control). Once booted, create the new
partition table on the new disk; create 200 MiB (give or take) for /boot,
the rest for LVM divided up with root (/) taking basically everything, and
swap if you really think you need it (usually 2 GiB or so). Mount /boot
and / (root) somewhere in your external-media-booted system, like
/mnt/new-boot and /mnt/new-root. In case it was not obvious, use ‘yast
disk’ (aka Partitioner) for all of this stuff, and be SURE you do not
change the partition table of your old disk, since that would be very
destructive.

Next mount the old filesystems somewhere too, like /mnt/old-filesystem.

Use ‘cp -a’ to copy lots of stuff from /mnt/old-filesystem/boot/* to
/mnt/new-boot/ and then from /mnt/old-filesystem/* to /mnt/new-root (yes,
you’ll end up with /boot duplicated; clean that up on the new filesystem
root).

Now for the hard part: fixing up /etc/fstab to handle the new UUIDs or
filesystem IDs or device IDs. This may be easy, or it may be hard, but
you’ll probably want to add a /boot line in there, make sure swap is
correct, and then be sure if your old system used UUIDs that you use the
new UUIDs for the new partitions. This may also very depending on SLES 11
or 12, which filesystem you used before (vs. now, in case you’re changing
filesystems to use better ones), etc.

Hopefully you can just expand something in LVM after growing (or adding) a
disk, but if you are using bare metal, or if you did not use LVM, that may
just not work.


Good luck.

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

Am 16.11.2016 um 00:59 schrieb ab:[color=blue]

Disclaimer: I have no idea what 3390, ‘mod-9’, or ‘mod-18’ mean, and I’m
too lazy to Google for the answer there.[/color]

Disclaimer: Me neither. But as he seems to be interested in doing this
works in a VM guest running on such a hardware, it shouldn’t really
matter, right?

CU,

Massimo Rosen
Micro Focus Knowledge Partner
No emails please!
http://www.cfc-it.de

Yes, the systems I work with are on the IBM mainframe. Some are guest systems and some are LPARS. I have come up with a process that works. I have done this twice so some refinements could be possible.
Process to copy a Red Hat 6.8 system on a 3390 mod-9 to a 3390 mod-18

[CODE]
- This system had only one (1) fixed partition for the entire disk.
There is no /boot or other partition defined.
Also, no swap or LVM defined.

      ipl 1568 
      cio_ignore -r 0.0.0502
      chccwdev -e 0.0.502
      dasdfmt -b 4096 -f /dev/dasdb -p -y
      fdasd -sa /dev/dasdb
      mke2fs -b 4096 -j /dev/dasdb
      dd if=/dev/dasda of=/dev/dasdb
      e2fsck -f /dev/dasdb1
      resize2fs /dev/dasdb1
      mount /dev/dasdb1 /mnt
      cd /mnt
      mount --bind /sys /mnt/sys
      mount --bind /proc /mnt/proc
      mount --bind /dev /mnt/dev
      chroot /mnt
      mkinitrd /boot/initramfs-2.6.32-642.el6.s390x.img 2.6.32-642.el6.s390x -f
      zipl -V
      exit
      umount /mnt/sys
      umount /mnt/proc
      umount /mnt/dev
      fdasd -sa /dev/dasdb
      e2fsck -f /dev/dasdb1
      resize2fs /dev/dasdb1
      halt
      #cp def 1568 0500
      #cp def 0502 1568
      #cp ipl 1568

System definition:
root@\ LINUX140 :[~] $ cat /etc/fstab

/etc/fstab

Created by anaconda on Mon Jul 9 17:57:10 2012

Accessible filesystems, by reference, are maintained under ‘/dev/disk’

See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info

/dev/disk/by-path/ccw-0.0.1568-part1 / ext3 defaults 1 1
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0

Input:
3390 mod-9
Filesystem Size Used Avail Use% Mounted on
/dev/dasda1 6.8G 5.9G 558M 92% /
tmpfs 1001M 0 1001M 0% /dev/shm

Output:
3390 mod-18
Filesystem Size Used Avail Use% Mounted on
/dev/dasda1 14G 6.0G 7.0G 47% /
tmpfs 1001M 0 1001M 0% /dev/shm[/CODE]