Here's quick detail about how to do what Michael Krysiak asked about:
 
I did what you're asking about: convert (by copying) a non-LVM, 2
minidisk (/ and /usr) SLES9 31-bit to turn it into a SLES9 guest that
has a non-LVM root-boot partition with the rest of its partitions and
dasd given to LVM. 
(Everyone has rightly scared me out of putting the whole thing onto LVM
because rescuing an all-LVM guest is much harder.)

You'll need to decide which directories you want in the non-LVM boot
partition and its size (100MB worked ok for booting but we later changed
it to 750MB so that YAST had enough space to install service packs)(Mark
Post suggested having 2 non-LVM partitions "A relatively small non-LVM
root partition. A separate, small non-LVM /boot partition" and you can
do that if you modify my steps)

Get the new boot mdisk/dasd online to your SLES9 guest;
 dasdfmt and fdasd the new boot mdisk/dasd;
Make an ext3 filesystem on the new root-boot partition;
Mount your new root-boot partition at /mnt
 mount  -t ext3 /dev/dasdx1 /mnt
For our purposes we put these directories into the new root-boot
partition using command (thank you to an IBM redpiece-book about scsi
and FCP):
cp -r --no-dereference --preserve=all --target-directory=/mnt /bin /boot
/dev /etc /lib /root /sbin /srv

cd /mnt and
 mkdir the LVM mount points:
 mkdir  usr var opt tmp home
mkdir sys proc       

Give the other partitions/dev/dasdxn's to LVM,
For example: pvcreate /dev/dasdh1 /dev/dasdj1 /dev/dasdk1    
Then vgcreate vg1 /dev/dasdh1 /dev/dasdj1 /dev/dasdk1
 to put them into a volume group;
Then  create the needed logical volumes for the missing directories
(your sizes will be different from mine; I put everything on 1 mod-3
dasd);
lvcreate -L 1200M -n usr vg1
  Logical volume "usr" created
lvcreate -L 256M -n var vg1
  Logical volume "var" created
lvcreate -L 184M -n opt vg1
  Logical volume "opt" created
lvcreate -L 200M -n tmp vg1
  Logical volume "tmp" created
lvcreate -L 44M -n home vg1
  Logical volume "home" created
lvcreate -L 128M -n swap1 vg1     (optional; probably controversial;
your choice)
  Logical volume "swap1" created
Make an ext3 filesystem on each non-swap LV

Then mount the LV's at their corresponding /mnt/ points:
Mount /dev/vg1/usr /mnt/usr
Mount Etc etc etc etc

Copy the /usr /var /opt /tmp/home filesystems or directories from old
partitions to new LV's using cp (see above) or Mark Post's link to the
tar method;

To make the new boot partition bootable, 
Prep so mkinitrd and zipl will work in the chroot environment:

mount  -t sysfs sysfs /mnt/sys
mount -t proc proc /mnt/proc

chroot /mnt

mkinitrd     (here's my mkinitrd's output, 0.0.0209 is the new boot dev)
Root device:    /dev/dasda1 (mounted on / as ext3)
Module list:    jbd ext3 dasd_diag_mod dasd_fba_mod dasd_eckd_mod

Kernel image:   /boot/image-2.6.5-7.151-s390
Initrd image:   /boot/initrd-2.6.5-7.151-s390
Shared libs:    lib/ld-2.3.3.so lib/libc.so.6 lib/libselinux.so.1
Modules:        kernel/fs/jbd/jbd.ko kernel/fs/ext3/ext3.ko
kernel/drivers/s390/block/dasd_mod.ko
kernel/drivers/s390/block/dasd_diag_mod.ko
kernel/drivers/s390/block/dasd_fba_mod.ko
kernel/drivers/s390/block/dasd_eckd_mod.ko
DASDs:           0.0.0200(ECKD) 0.0.0201(ECKD) 0.0.0209(ECKD)

zipl -V                Use -V flag to see what zipl is doing
(here's my zipl output; note 
Using config file '/etc/zipl.conf'
Target device information
  Device..........................: 5e:08
  Partition.......................: 5e:09
  Device name.....................: dasdc
  DASD device number..............: 0209
  Type............................: disk partition
  Disk layout.....................: ECKD/compatible disk layout
  Geometry - heads................: 15
  Geometry - sectors..............: 12
  Geometry - cylinders............: 3338
  Geometry - start................: 24
  File system block size..........: 4096
  Physical block size.............: 4096
  Device size in physical blocks..: 25596
Building bootmap '/boot/zipl/bootmap'
Adding IPL section 'ipl' (default)
  kernel image......: /boot/image at 0x10000
  kernel parmline...: 'root=/dev/dasda1 selinux=0 TERM=dumb
elevator=cfq' at 0x1000
  initial ramdisk...: /boot/initrd at 0x800000
Preparing boot device: dasdc (0209).
Syncing disks...
Done.

 exit          *To exit the chroot environment.

mkswap /dev/vg1/swap1         *Put a swap signature on the swap device

cp -a /mnt/etc/fstab /mnt/etc/fstab1     *backup fstab
vi  /mnt/etc/fstab              *and change the /dev/dasdb1 swap mount
to /dev/vg1/swap1

cat /mnt/etc/fstab
/dev/dasda1          /                    ext3       acl,user_xattr
1 1
/dev/vg1/usr         /usr                 ext3       acl,user_xattr
1 2
/dev/vg1/var         /var                 ext3       acl,user_xattr
1 2
/dev/vg1/opt         /opt                 ext3       acl,user_xattr
1 2
/dev/vg1/home        /home                ext3       acl,user_xattr
1 2
/dev/vg1/tmp         /tmp                 ext3       acl,user_xattr
1 2
/dev/vg1/swap1       none                 swap       pri=42
0 0
devpts               /dev/pts             devpts     mode=0620,gid=5
0 0
proc                 /proc                proc       defaults
0 0
sysfs                /sys                 sysfs      noauto
0 0

shutdown Linux and test booting the new system:
My old boot vdev was 200 and my new boot vdev is (temporarily) at 209, I
still want to boot off 200:
 CP DETACH 200
CP DEFINE 209   200
IPL 200
SLES9 boot messages will say 209 isn't available (it was there during
mkinitrd)
(if it boots ok then rerun mkinitrd and zipl to get rid of the disk not
available message)
 
Change VM directory definition of your SLES9 to delete the old 200
(unused now) mdisk and change address of 209 to 200;

You're done.


--------------------------------------------------------
This e-mail, including any attachments, may be confidential, privileged or 
otherwise legally protected. It is intended only for the addressee. If you 
received this e-mail in error or from someone who was not authorized to send it 
to you, do not disseminate, copy or otherwise use this e-mail or its 
attachments.  Please notify the sender immediately by reply e-mail and delete 
the e-mail from your system.


-----Original Message-----

From: Linux on 390 Port [mailto:[EMAIL PROTECTED] On Behalf Of
Michael Krysiak
Sent: Thursday, January 05, 2006 10:47 AM
To: LINUX-390@VM.MARIST.EDU
Subject: Copying a SLES9 installation

I currently have a 31 bit installation of SLES9 on two dasd, one mdisk
is
mounted as / and the other as /usr.  We aren't using logicial volumes.
We
would like to copy this installation to a logical volume with 9 dasd.
What
is the recommended way of doing this?  Or is it necessary to do a new
install?

Thanks,
Michael Krysiak

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or
visit
http://www.marist.edu/htbin/wlvindex?LINUX-390

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390

Reply via email to