Reserve Orig

By admin  

CLICK HERE for more information on TOTAL HOME DECOR!

CLICK HERE for more information on HOME AMUSEMENTS!

CLICK HERE for more information on UNIQUE LIGHTING!

Reserve Orig

Convert to LVM for the rootvg on local drive

Convert to LVM for the rootvg on local drive

 

  1. Check the current setup

 

[root@lab1 ~]# df -h

Filesystem            Size  Used Avail Use% Mounted on

  1. /dev/cciss/c0d0p1      18G  2.9G   14G  18% /

tmpfs                1005M     0 1005M   0% /dev/shm

 

[root@lab1 ~]# fdisk -l /dev/cciss/c0d0

 

Disk /dev/cciss/c0d0: 73.3 GB, 73372631040 bytes

255 heads, 63 sectors/track, 8920 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

 

           Device Boot      Start         End      Blocks   Id  System

/dev/cciss/c0d0p1   *           1        2350    18876343+  83  Linux

/dev/cciss/c0d0p2            2351        3394     8385930   82  Linux swap / Solaris

 

  1. Remove the current swap space to make room for a temporary root partition

 

[root@lab1 ~]# swapoff -a -v

[root@lab1 ~]# fdisk /dev/cciss/c0d0

 

The number of cylinders for this disk is set to 8920.

There is nothing wrong with that, but this is larger than 1024,

and could in certain setups cause problems with:

1) software that runs at boot time (e.g., old versions of LILO)

2) booting and partitioning software from other OSs

   (e.g., DOS FDISK, OS/2 FDISK)

 

Command (m for help): d

Partition number (1-4): 2

 

Command (m for help): p

 

Disk /dev/cciss/c0d0: 73.3 GB, 73372631040 bytes

255 heads, 63 sectors/track, 8920 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

 

           Device Boot      Start         End      Blocks   Id  System

/dev/cciss/c0d0p1   *           1        2350    18876343+  83  Linux

 

Command (m for help): w

The partition table has been altered!

 

Calling ioctl() to re-read partition table.

 

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.

The kernel still uses the old table.

The new table will be used at the next reboot.

Syncing disks.

[root@lab1 ~]# partprobe

 

  1. Make sure to leave enough room, so that you can create /boot partition on slice 1, since /boot can not be under LVM support.

 

[root@lab1 ~]# fdisk /dev/cciss/c0d0

Command (m for help): p

 

Disk /dev/cciss/c0d0: 73.3 GB, 73372631040 bytes

255 heads, 63 sectors/track, 8920 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

 

           Device Boot      Start         End      Blocks   Id  System

/dev/cciss/c0d0p1   *           1        2350    18876343+  83  Linux

 

Command (m for help): n

Command action

   e   extended

   p   primary partition (1-4)

p

Partition number (1-4): 3

First cylinder (2351-8920, default 2351): 2371

Last cylinder or +size or +sizeM or +sizeK (2371-8920, default 8920): 4721

 

Command (m for help): w

The partition table has been altered!

 

Calling ioctl() to re-read partition table.

 

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.

The kernel still uses the old table.

The new table will be used at the next reboot.

Syncing disks.

[root@lab1 ~]# partprobe

 

  1. Create a filesystem on the new slice, and copy the contents of slice 1 over.

 

[root@lab1 ~]# mke2fs -j /dev/cciss/c0d0p3

mke2fs 1.39 (29-May-2006)

Filesystem label=

OS type: Linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

2361760 inodes, 4721101 blocks

236055 blocks (5.00%) reserved for the super user

First data block=0

Maximum filesystem blocks=4294967296

145 block groups

32768 blocks per group, 32768 fragments per group

16288 inodes per group

Superblock backups stored on blocks:

       32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,

       4096000

 

Writing inode tables: done                           

Creating journal (32768 blocks): done

Writing superblocks and filesystem accounting information: done

 

This filesystem will be automatically checked every 37 mounts or

180 days, whichever comes first.  Use tune2fs -c or -i to override.

[root@lab1 ~]# mount -t ext3 /dev/cciss/c0d0p3 /mnt

[root@lab1 ~]# cd /

[root@lab1 /]# find / -xdev|cpio -pvmd /mnt

 

  1. Make the new partition bootable.

 

[root@lab1 /]# fdisk /dev/cciss/c0d0

 

The number of cylinders for this disk is set to 8920.

There is nothing wrong with that, but this is larger than 1024,

and could in certain setups cause problems with:

1) software that runs at boot time (e.g., old versions of LILO)

2) booting and partitioning software from other OSs

   (e.g., DOS FDISK, OS/2 FDISK)

 

Command (m for help): p

 

Disk /dev/cciss/c0d0: 73.3 GB, 73372631040 bytes

255 heads, 63 sectors/track, 8920 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

 

           Device Boot      Start         End      Blocks   Id  System

/dev/cciss/c0d0p1   *           1        2350    18876343+  83  Linux

/dev/cciss/c0d0p3            2371        4721    18884407+  83  Linux

 

Command (m for help): a

Partition number (1-4): 3

 

Command (m for help): a

Partition number (1-4): 1

 

Command (m for help): p

 

Disk /dev/cciss/c0d0: 73.3 GB, 73372631040 bytes

255 heads, 63 sectors/track, 8920 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

 

           Device Boot      Start         End      Blocks   Id  System

/dev/cciss/c0d0p1               1        2350    18876343+  83  Linux

/dev/cciss/c0d0p3   *        2371        4721    18884407+  83  Linux

 

Command (m for help): w

The partition table has been altered!

 

Calling ioctl() to re-read partition table.

 

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.

The kernel still uses the old table.

The new table will be used at the next reboot.

Syncing disks.

[root@lab1 /]# partprobe

 

  1. Edit the /mnt/etc/fstab file to point to the new partition.

 

[root@lab1 /]# vi /mnt/etc/fstab

[root@lab1 /]# cat /mnt/etc/fstab

/dev/cciss/c0d0p3    /                       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

[root@lab1 /]#

 

  1. Edit the /mnt/boot/grub/grub.conf and /boot/grub/grub.conf file to point to the new partition also.

 

[root@lab1 /]# vi /mnt/boot/grub/grub.conf

[root@lab1 /]# cat /mnt/boot/grub/grub.conf

# grub.conf generated by anaconda

#

# Note that you do not have to rerun grub after making changes to this file

# NOTICE:  You do not have a /boot partition.  This means that

#          all kernel and initrd paths are relative to /, eg.

#          root (hd0,0)

#          kernel /boot/vmlinuz-version ro root=/dev/cciss/c0d0p1

#          initrd /boot/initrd-version.img

#boot=/dev/cciss/c0d0

default=0

timeout=5

splashimage=(hd0,0)/boot/grub/splash.xpm.gz

hiddenmenu

title Red Hat Enterprise Linux Server (2.6.18-92.el5)

       root (hd0,0)

       kernel /boot/vmlinuz-2.6.18-92.el5 ro root=/dev/cciss/c0d0p3 pci=nommconf rhgb quiet

       initrd /boot/initrd-2.6.18-92.el5.img

 [root@lab1 /]# vi /boot/grub/grub.conf

[root@lab1 /]# cat /boot/grub/grub.conf

# grub.conf generated by anaconda

#

# Note that you do not have to rerun grub after making changes to this file

# NOTICE:  You do not have a /boot partition.  This means that

#          all kernel and initrd paths are relative to /, eg.

#          root (hd0,0)

#          kernel /boot/vmlinuz-version ro root=/dev/cciss/c0d0p1

#          initrd /boot/initrd-version.img

#boot=/dev/cciss/c0d0

default=0

timeout=5

splashimage=(hd0,0)/boot/grub/splash.xpm.gz

hiddenmenu

title Red Hat Enterprise Linux Server (2.6.18-92.el5)

       root (hd0,0)

       kernel /boot/vmlinuz-2.6.18-92.el5 ro root=/dev/cciss/c0d0p3 pci=nommconf rhgb quiet

       initrd /boot/initrd-2.6.18-92.el5.img

 

  1. Reboot the server, and it should come up on the new partition.

 

[root@lab1 ~]# df -k

Filesystem           1K-blocks      Used Available Use% Mounted on

/dev/cciss/c0d0p3     18587892   2984316  14659356  17% /

tmpfs                  1029044         0   1029044   0% /dev/shm

 

  1. Remove slice 1 and create a /boot partition on slice 1, and the new root partition on slice 2.

 

[root@lab1 ~]# fdisk /dev/cciss/c0d0

Command (m for help): p

 

Disk /dev/cciss/c0d0: 73.3 GB, 73372631040 bytes

255 heads, 63 sectors/track, 8920 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

 

           Device Boot      Start         End      Blocks   Id  System

/dev/cciss/c0d0p1               1        2350    18876343+  83  Linux

/dev/cciss/c0d0p3   *        2371        4721    18884407+  83  Linux

 

Command (m for help): d

Partition number (1-4): 1

 

Command (m for help): w

The partition table has been altered!

 

Calling ioctl() to re-read partition table.

 

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.

The kernel still uses the old table.

The new table will be used at the next reboot.

 

[root@lab1 ~]# fdisk /dev/cciss/c0d0

 

The number of cylinders for this disk is set to 8920.

There is nothing wrong with that, but this is larger than 1024,

and could in certain setups cause problems with:

1) software that runs at boot time (e.g., old versions of LILO)

2) booting and partitioning software from other OSs

   (e.g., DOS FDISK, OS/2 FDISK)

 

Command (m for help): p

 

Disk /dev/cciss/c0d0: 73.3 GB, 73372631040 bytes

255 heads, 63 sectors/track, 8920 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

 

           Device Boot      Start         End      Blocks   Id  System

/dev/cciss/c0d0p3   *        2371        4721    18884407+  83  Linux

 

Command (m for help): n

Command action

   e   extended

   p   primary partition (1-4)

p

Partition number (1-4): 1

First cylinder (1-8920, default 1):

Using default value 1

Last cylinder or +size or +sizeM or +sizeK (1-2370, default 2370): 20

 

Command (m for help): p

 

Disk /dev/cciss/c0d0: 73.3 GB, 73372631040 bytes

255 heads, 63 sectors/track, 8920 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

 

           Device Boot      Start         End      Blocks   Id  System

/dev/cciss/c0d0p1               1          20      160618+  83  Linux

/dev/cciss/c0d0p3   *        2371        4721    18884407+  83  Linux

 

Command (m for help): n

Command action

   e   extended

   p   primary partition (1-4)

p

Partition number (1-4): 2

First cylinder (21-8920, default 21): 21

Last cylinder or +size or +sizeM or +sizeK (21-2370, default 2370): 2370

 

Command (m for help): p

 

Disk /dev/cciss/c0d0: 73.3 GB, 73372631040 bytes

255 heads, 63 sectors/track, 8920 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

 

           Device Boot      Start         End      Blocks   Id  System

/dev/cciss/c0d0p1               1          20      160618+  83  Linux

/dev/cciss/c0d0p2              21        2370    18876375   83  Linux

/dev/cciss/c0d0p3   *        2371        4721    18884407+  83  Linux

 

Command (m for help): w

The partition table has been altered!

 

Calling ioctl() to re-read partition table.

 

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.

The kernel still uses the old table.

The new table will be used at the next reboot.

Syncing disks.

[root@lab1 ~]# partprobe

 

10. Change the partition type of 2 to LVM (8e) and make the partition 1 bootable.

 

[root@lab1 ~]# fdisk /dev/cciss/c0d0

 

The number of cylinders for this disk is set to 8920.

There is nothing wrong with that, but this is larger than 1024,

and could in certain setups cause problems with:

1) software that runs at boot time (e.g., old versions of LILO)

2) booting and partitioning software from other OSs

   (e.g., DOS FDISK, OS/2 FDISK)

 

Command (m for help): p

 

Disk /dev/cciss/c0d0: 73.3 GB, 73372631040 bytes

255 heads, 63 sectors/track, 8920 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

 

           Device Boot      Start         End      Blocks   Id  System

/dev/cciss/c0d0p1               1          20      160618+  83  Linux

/dev/cciss/c0d0p2              21        2370    18876375   83  Linux

/dev/cciss/c0d0p3   *        2371        4721    18884407+  83  Linux

 

Command (m for help): t

Partition number (1-4): 2

Hex code (type L to list codes): 8e

Changed system type of partition 2 to 8e (Linux LVM)

 

Command (m for help): a

Partition number (1-4): 1

 

Command (m for help): a

Partition number (1-4): 3

 

Command (m for help): p

 

Disk /dev/cciss/c0d0: 73.3 GB, 73372631040 bytes

255 heads, 63 sectors/track, 8920 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

 

           Device Boot      Start         End      Blocks   Id  System

/dev/cciss/c0d0p1   *           1          20      160618+  83  Linux

/dev/cciss/c0d0p2              21        2370    18876375   8e  Linux LVM

/dev/cciss/c0d0p3            2371        4721    18884407+  83  Linux

 

Command (m for help): w

The partition table has been altered!

 

Calling ioctl() to re-read partition table.

 

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.

The kernel still uses the old table.

The new table will be used at the next reboot.

Syncing disks.

[root@lab1 ~]# partprobe

 

11. tar the contents of the original /boot dir.

 

 [root@lab1 /]# cd /boot

[root@lab1 boot]# tar -cvf /tmp/boot.tar *

config-2.6.18-92.el5

grub/

grub/stage2

grub/fat_stage1_5

grub/ufs2_stage1_5

grub/ffs_stage1_5

grub/menu.lst

grub/jfs_stage1_5

grub/splash.xpm.gz

grub/xfs_stage1_5

grub/reiserfs_stage1_5

grub/grub.conf

grub/stage1

grub/iso9660_stage1_5

grub/device.map

grub/e2fs_stage1_5

grub/minix_stage1_5

grub/vstafs_stage1_5

initrd-2.6.18-92.el5.img

initrd-2.6.18-92.el5.img.orig

symvers-2.6.18-92.el5.gz

System.map-2.6.18-92.el5

vmlinuz-2.6.18-92.el5

 

12. Create a new filesystem on slice 1 , the new boot partition.

 

[root@lab1 /]# mke2fs -j/dev/cciss/c0d0p1

mke2fs 1.39 (29-May-2006)

Filesystem label=

OS type: Linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

2361760 inodes, 4721101 blocks

236055 blocks (5.00%) reserved for the super user

First data block=0

Maximum filesystem blocks=4294967296

145 block groups

32768 blocks per group, 32768 fragments per group

16288 inodes per group

Superblock backups stored on blocks:

       32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,

       4096000

 

Writing inode tables: done                           

Creating journal (32768 blocks): done

Writing superblocks and filesystem accounting information: done

 

This filesystem will be automatically checked every 37 mounts or

180 days, whichever comes first.  Use tune2fs -c or -i to override.

 

 

13. Delete everything in the original /boot filesystem on the temporary partition.

 

[root@lab1 mnt]# cd /boot

[root@lab1 boot]# ls

  1. config-2.6.18-92.el5  initrd-2.6.18-92.el5.img       symvers-2.6.18-92.el5.gz  vmlinuz-2.6.18-92.el5

grub                  initrd-2.6.18-92.el5.img.orig  System.map-2.6.18-92.el5

[root@lab1 boot]# rm -f -r *

 

14. Mount slice 1 onto /boot and untar the contents.

 

 [root@lab1 /]# mount -t ext3 /dev/cciss/c0d0p1 /boot

[root@lab1 /]# cd /boot

[root@lab1 boot]# tar -xvf /tmp/boot.tar

config-2.6.18-92.el5

grub/

grub/minix_stage1_5

grub/jfs_stage1_5

grub/device.map

grub/splash.xpm.gz

grub/fat_stage1_5

grub/e2fs_stage1_5

grub/ffs_stage1_5

grub/xfs_stage1_5

grub/ufs2_stage1_5

grub/iso9660_stage1_5

grub/vstafs_stage1_5

grub/stage1

grub/grub.conf

grub/reiserfs_stage1_5

grub/menu.lst

grub/stage2

initrd-2.6.18-92.el5.img

initrd-2.6.18-92.el5.img.orig

symvers-2.6.18-92.el5.gz

System.map-2.6.18-92.el5

vmlinuz-2.6.18-92.el5

[root@lab1 boot]# pwd

/boot

[root@lab1 boot]# ls

  1. config-2.6.18-92.el5  initrd-2.6.18-92.el5.img       lost+found                   System.map-2.6.18-92.el5

grub                initrd-2.6.18-92.el5.img.orig  symvers-2.6.18-92.el5.gz  vmlinuz-2.6.18-92.el5

 

15. Change /etc/fstab to point to the new /boot partition.

 

[root@lab1 boot]# vi /etc/fstab

[root@lab1 boot]# cat /etc/fstab

/dev/cciss/c0d0p3    /                       ext3    defaults        1 1

/dev/cciss/c0d0p1    /boot                ext3   defaults      1 2

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

 

16. Recreate the intitrd image.

 

[root@lab1 ~]# mkinitrd -f /boot/initrd-2.6.18-92.el5.img `uname -r`

 

17. Create a new MBR for the new /boot partition.

 

[root@lab1 /]# grub-install /dev/cciss/c0d0

Installation finished. No error reported.

This is the contents of the device map /boot/grub/device.map.

Check if this is correct or not. If any of the lines is incorrect,

fix it and re-run the script `grub-install’.

 

# this device map was generated by anaconda

(hd0)     /dev/cciss/c0d0

 

18. Remove the /boot references in the /boot/grub/grub.conf file.

 

[root@lab1 ~]# vi /boot/grub/grub.conf

[root@lab1 ~]# cat /boot/grub/grub.conf

# grub.conf generated by anaconda

#

# Note that you do not have to rerun grub after making changes to this file

# NOTICE:  You do not have a /boot partition.  This means that

#          all kernel and initrd paths are relative to /, eg.

#          root (hd0,0)

#          kernel /boot/vmlinuz-version ro root=/dev/cciss/c0d0p1

#          initrd /boot/initrd-version.img

#boot=/dev/cciss/c0d0

default=0

timeout=5

splashimage=(hd0,0)/grub/splash.xpm.gz

hiddenmenu

title Red Hat Enterprise Linux Server (2.6.18-92.el5)

       root (hd0,0)

       kernel /vmlinuz-2.6.18-92.el5 ro root=/dev/cciss/c0d0p3 pci=nommconf rhgb quiet

       initrd /initrd-2.6.18-92.el5.img

 

19. Reboot, and it will boot off the new /boot partition.

 

[root@lab1 ~]# df -k

Filesystem           1K-blocks      Used Available Use% Mounted on

/dev/cciss/c0d0p3     18587892   2984528  14659144  17% /

/dev/cciss/c0d0p1       155543     15571    131942  11% /boot

tmpfs                  1029044         0   1029044   0% /dev/shm

 

20. Initialize the LVM

 

[root@lab1 /]# vgscan

  Reading all physical volumes.  This may take a while…

  Found volume group “uservg” using metadata type lvm2

 

21. Create a physical volume on partition 2 that was created earlier.

 

[root@lab1 /]# pvcreate /dev/cciss/c0d0p2

  Physical volume “/dev/cciss/c0d0p2″ successfully created

 

22. Create the root volume group on the partition just created.

 

[root@lab1 /]# vgcreate rootvg /dev/cciss/c0d0p2

  Volume group “rootvg” successfully created

 

23. Create a logical volume for the new root volume group.

 

[root@lab1 /]# lvcreate -n lv00 –size 18G rootvg

  Logical volume “lv00″ created

 

24. Create a filesystem on the new logical volume.

 

[root@lab1 /]# mke2fs -j /dev/rootvg/lv00

mke2fs 1.39 (29-May-2006)

Filesystem label=

OS type: Linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

2359296 inodes, 4718592 blocks

235929 blocks (5.00%) reserved for the super user

First data block=0

Maximum filesystem blocks=4294967296

144 block groups

32768 blocks per group, 32768 fragments per group

16384 inodes per group

Superblock backups stored on blocks:

       32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,

       4096000

 

Writing inode tables: done                           

Creating journal (32768 blocks): done

Writing superblocks and filesystem accounting information: done

 

This filesystem will be automatically checked every 29 mounts or

180 days, whichever comes first.  Use tune2fs -c or -i to override.

 

25. Mount the new filesystem and copy the root files over.

 

[root@lab1 /]# mount -t ext3 /dev/rootvg/lv00 /mnt

[root@lab1 /]# cd /

[root@lab1 /]# find / -xdev | cpio -pvmd /mnt

……..

/mnt/usr/include/gnome-desktop-2.0/libgnomeui

/mnt/usr/include/gnome-desktop-2.0/libgnomeui/gnome-ditem-edit.h

/mnt/usr/include/gnome-desktop-2.0/libgnomeui/gnome-hint.h

/mnt/usr/include/mpfr.h

/mnt/usr/include/ftw.h

/mnt/usr/include/spawn.h

/mnt/lost+found

5030570 blocks

[root@lab1 /]#

 

26. Recreate the initrd image.

 

[root@lab1 /]# mkinitrd –f /boot/initrd-2.6.18-92.el5.img `uname –r`

 

27. Make sure the initrd image is configured for LVM.

 

[root@lab1 /]# cd /tmp

[root@lab1 tmp]# mkdir working-intitrd

[root@lab1 tmp]# cd working-intitrd

[root@lab1 working-intitrd]# zcat /boot/initrd-2.6.18-92.el5.img|cpio -i

17771 blocks

[root@lab1 working-intitrd]# ls bin/lvm

bin/lvm

[root@lab1 working-intitrd]# ls etc/lvm

lvm.conf

 

 

28. If the image does not LVM support it can be added this way.

 

[root@lab1 working-intitrd]# cp -r /etc/lvm etc/

cp: overwrite `etc/lvm/backup/rootvg’? y

cp: overwrite `etc/lvm/backup/uservg’? y

cp: overwrite `etc/lvm/archive/rootvg_00001.vg’? y

cp: overwrite `etc/lvm/archive/uservg_00000.vg’? y

cp: overwrite `etc/lvm/archive/rootvg_00000.vg’? y

cp: overwrite `etc/lvm/lvm.conf.default’? y

cp: overwrite `etc/lvm/cache/.cache’? y

cp: overwrite `etc/lvm/lvm.conf’? y

[root@lab1 working-intitrd]# pwd

/tmp/working-intitrd

[root@lab1 working-intitrd]# ls etc/lvm/

archive  backup  cache  lvm.conf  lvm.conf.default

[root@lab1 working-intitrd]# pwd

/tmp/working-intitrd

[root@lab1 working-intitrd]# find . -print | cpio -o -c |gzip -9 > /tmp/initrd-2.6.18-92.el5.img

17817 blocks

 

[root@lab1 working-intitrd]# cp /boot/initrd-2.6.18-92.el5.img /boot/initrd-2.6.18-92.el5.img.bak

[root@lab1 working-intitrd]# ls -l /boot/initrd-2.6.18-92.el5.img.bak /tmp/initrd-2.6.18-92.el5.img

-rw——- 1 root root 3713844 May 20 15:23 /boot/initrd-2.6.18-92.el5.img.bak

-rw-r–r– 1 root root 3716171 May 20 15:22 /tmp/initrd-2.6.18-92.el5.img

[root@lab1 working-intitrd]# cp /boot/initrd-2.6.18-92.el5.img.bak /boot/initrd-2.6.18-92.el5.img

 

29. Edit the /mnt/etc/fstab to reflect the new rootvg volume group

 

[root@lab1 /]# vi /mnt/etc/fstab

[root@lab1 /]# cat /mnt/etc/fstab

/dev/rootvg/lv00     /                       ext3    defaults        1 1

/dev/cciss/c0d0p1    /boot                ext3   defaults      1 2

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

 

30. Edit the /boot/grub/grub.conf to point to the new rootvg

 

[root@lab1 /]# vi /boot/grub/grub.conf

[root@lab1 /]# cat /boot/grub/grub.conf

# grub.conf generated by anaconda

#

# Note that you do not have to rerun grub after making changes to this file

# NOTICE:  You do not have a /boot partition.  This means that

#          all kernel and initrd paths are relative to /, eg.

#          root (hd0,0)

#          kernel /boot/vmlinuz-version ro root=/dev/cciss/c0d0p1

#          initrd /boot/initrd-version.img

#boot=/dev/cciss/c0d0

default=0

timeout=5

splashimage=(hd0,0)/grub/splash.xpm.gz

hiddenmenu

title Red Hat Enterprise Linux Server (2.6.18-92.el5)

       root (hd0,0)

       kernel /vmlinuz-2.6.18-92.el5 ro root=/dev/rootvg/lv00 pci=nommconf rhgb quiet

       initrd /initrd-2.6.18-92.el5.img

 

31. Run grub-install to recreate the MBR.

 

[root@lab1 /]# grub-install /dev/cciss/c0d0

Installation finished. No error reported.

This is the contents of the device map /boot/grub/device.map.

Check if this is correct or not. If any of the lines is incorrect,

fix it and re-run the script `grub-install’.

 

# this device map was generated by anaconda

(hd0)     /dev/cciss/c0d0

 

32. Reboot, and it should come up under LVM support.

 

[root@lab1 ~]# df -k

Filesystem           1K-blocks      Used Available Use% Mounted on

/dev/mapper/rootvg-lv00

                      18578172   2984604  14649852  17% /

/dev/cciss/c0d0p1       155543     19214    128299  14% /boot

tmpfs                  1029044         0   1029044   0% /dev/shm

 

33. Delete the temporary root partition 3.

 

[root@lab1 ~]# fdisk /dev/cciss/c0d0

 

The number of cylinders for this disk is set to 8920.

There is nothing wrong with that, but this is larger than 1024,

and could in certain setups cause problems with:

1) software that runs at boot time (e.g., old versions of LILO)

2) booting and partitioning software from other OSs

   (e.g., DOS FDISK, OS/2 FDISK)

 

Command (m for help): p

 

Disk /dev/cciss/c0d0: 73.3 GB, 73372631040 bytes

255 heads, 63 sectors/track, 8920 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

 

           Device Boot      Start         End      Blocks   Id  System

/dev/cciss/c0d0p1   *           1          20      160618+  83  Linux

/dev/cciss/c0d0p2              21        2370    18876375   8e  Linux LVM

/dev/cciss/c0d0p3            2371        4721    18884407+  83  Linux

 

Command (m for help): d

Partition number (1-4): 3

 

Command (m for help): w

The partition table has been altered!

 

Calling ioctl() to re-read partition table.

 

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.

The kernel still uses the old table.

The new table will be used at the next reboot.

Syncing disks.

[root@lab1 ~]# partprobe

 

34. Create a swap partition.

 

[root@lab1 ~]# fdisk /dev/cciss/c0d0

 

The number of cylinders for this disk is set to 8920.

There is nothing wrong with that, but this is larger than 1024,

and could in certain setups cause problems with:

1) software that runs at boot time (e.g., old versions of LILO)

2) booting and partitioning software from other OSs

   (e.g., DOS FDISK, OS/2 FDISK)

 

Command (m for help): p

 

Disk /dev/cciss/c0d0: 73.3 GB, 73372631040 bytes

255 heads, 63 sectors/track, 8920 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

 

           Device Boot      Start         End      Blocks   Id  System

/dev/cciss/c0d0p1   *           1          20      160618+  83  Linux

/dev/cciss/c0d0p2              21        2370    18876375   8e  Linux LVM

 

Command (m for help): n

Command action

   e   extended

   p   primary partition (1-4)

p

Partition number (1-4): 3

First cylinder (2371-8920, default 2371): 2371

Last cylinder or +size or +sizeM or +sizeK (2371-8920, default 8920): +8192M

 

Command (m for help): p

 

Disk /dev/cciss/c0d0: 73.3 GB, 73372631040 bytes

255 heads, 63 sectors/track, 8920 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

 

           Device Boot      Start         End      Blocks   Id  System

/dev/cciss/c0d0p1   *           1          20      160618+  83  Linux

/dev/cciss/c0d0p2              21        2370    18876375   8e  Linux LVM

/dev/cciss/c0d0p3            2371        3367     8008402+  83  Linux

 

Command (m for help): t

Partition number (1-4): 82

Value out of range.

Partition number (1-4): p

Partition number (1-4): 3

Hex code (type L to list codes): 82

Changed system type of partition 3 to 82 (Linux swap / Solaris)

 

Command (m for help): p

 

Disk /dev/cciss/c0d0: 73.3 GB, 73372631040 bytes

255 heads, 63 sectors/track, 8920 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

 

           Device Boot      Start         End      Blocks   Id  System

/dev/cciss/c0d0p1   *           1          20      160618+  83  Linux

/dev/cciss/c0d0p2              21        2370    18876375   8e  Linux LVM

/dev/cciss/c0d0p3            2371        3367     8008402+  82  Linux swap / Solaris

 

Command (m for help): w

The partition table has been altered!

 

Calling ioctl() to re-read partition table.

 

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.

The kernel still uses the old table.

The new table will be used at the next reboot.

Syncing disks.

[root@lab1 ~]# partprobe

 

35. Create swap space on the partition.

 

[root@lab1 ~]# mkswap /dev/cciss/c0d0p3

Setting up swapspace version 1, size = 8200597 kB

[root@lab1 ~]# vi /etc/fstab

[root@lab1 ~]# cat /etc/fstab

/dev/rootvg/lv00     /                       ext3    defaults        1 1

/dev/cciss/c0d0p1    /boot                ext3   defaults      1 2

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

/dev/cciss/c0d0p3    swap                 swap   defaults      0 0

[root@lab1 ~]# mount -a

[root@lab1 ~]# swapon -a

[root@lab1 ~]# swapon -s

Filename                          Type          Size   Used   Priority

/dev/cciss/c0d0p3                       partition      8008392       0      -1

 

35. Reboot and make sure everything comes up okay.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

About the Author

I’ve been in the IT industry for over 15 years, and I am currently a System Administrator specializing in AIX, Solaris, and Redhat.

Anthony Cicone
www.agccomputerservices.com

“Woke Up: New Orleans”: A man wakes up and plasters his vision of Obama in New Orleans

eBay Logo  

Complete Hi -End Home Theater. orig cost $22405.00


Complete Hi -End Home Theater. orig cost $22405.00 “NO RESERVE!!!!”


$11,150.00


Evening With Friends by Terry Redlin Orig Print Ltd. Ed. Framed - NO RESERVE


Evening With Friends by Terry Redlin Orig Print Ltd. Ed. Framed – NO RESERVE


$660.00


1955 GLOBE EXPLORER SPACE BANK/ORIG BOX & INSERTS Hard to find-RARE No Reserve!!


1955 GLOBE EXPLORER SPACE BANK/ORIG BOX & INSERTS Hard to find-RARE No Reserve!!


$428.00


Comforts of Home by Terry Redlin Orig Print Ltd. Ed. Framed - NO RESERVE


Comforts of Home by Terry Redlin Orig Print Ltd. Ed. Framed – NO RESERVE


$380.00





“Wanted 25,000 student nurses” orig. WW1 recruitment by US Student Nurse Reserve


$349.00


Morning Solitude by Terry Redlin Orig Print Ltd. Ed. Framed - NO RESERVE


Morning Solitude by Terry Redlin Orig Print Ltd. Ed. Framed – NO RESERVE


$255.00


LARGE ALASKA PIPELINE MAP MADE FROM THE ORIG PIPELINE 1 OF A KIND NO RESERVE


LARGE ALASKA PIPELINE MAP MADE FROM THE ORIG PIPELINE 1 OF A KIND NO RESERVE


$245.00


1960's Gibson Melody Maker SG Pickguard w/orig Pickup! Sounds Great No Reserve!!


1960′s Gibson Melody Maker SG Pickguard w/orig Pickup! Sounds Great No Reserve!!


$199.00


3 TIER 12 LIGHT CHANDELIER*NIB*NO RESERVE*ORIG$745.00


3 TIER 12 LIGHT CHANDELIER*NIB*NO RESERVE*ORIG$745.00


$149.99


VINTAGE 18K VACHERON & CONSTANTIN MEN'S WATCH Black Dial & Orig Box!  No Reserve


VINTAGE 18K VACHERON & CONSTANTIN MEN’S WATCH Black Dial & Orig Box! No Reserve


$152.50


EXCELLENT- NO RESERVE  Lionel 6-18567 1997 PENNSYLVANIA GP-9 DIESEL Orig Box


EXCELLENT- NO RESERVE Lionel 6-18567 1997 PENNSYLVANIA GP-9 DIESEL Orig Box


$120.00


RARE 1987 Michael Jackson pets Bubbles the Chimp Orig Bx RARE HTF NO RESERVE


RARE 1987 Michael Jackson pets Bubbles the Chimp Orig Bx RARE HTF NO RESERVE


$129.99


AMX MODERO VIEWPOINT MVP-8400, USED DEMO MODEL, ORIG.$3500, NO RESERVE!


AMX MODERO VIEWPOINT MVP-8400, USED DEMO MODEL, ORIG.$3500, NO RESERVE!


$99.00


MEDIUM BLACK BADGLEY MISCHKA HANDBAG..ORIG $398.00..NO RESERVE


MEDIUM BLACK BADGLEY MISCHKA HANDBAG..ORIG $398.00..NO RESERVE


$99.00


Fitz and Floyd, Napoleon Bonaparte, NO RESERVE, Mint, w. Orig Box


Fitz and Floyd, Napoleon Bonaparte, NO RESERVE, Mint, w. Orig Box


$94.95


BEAUTIFUL KICHLER CHANDELIER*NIB*NO RESERVE*ORIG$400.00


BEAUTIFUL KICHLER CHANDELIER*NIB*NO RESERVE*ORIG$400.00


$79.99


VINTAGE BULOVA ORIG ART DECO WRISTWATCH RUNNING VG COND NO RESERVE


VINTAGE BULOVA ORIG ART DECO WRISTWATCH RUNNING VG COND NO RESERVE


$85.00


Tonka Mound Minn Stake Bed Truck No. 56 Jeep 1950s-60s Orig Box NRMT No Reserve


Tonka Mound Minn Stake Bed Truck No. 56 Jeep 1950s-60s Orig Box NRMT No Reserve


$75.00


BEAUTIFUL 6 LIGHT CHANDELIER*NIB*NO RESERVE!ORIG$390.00


BEAUTIFUL 6 LIGHT CHANDELIER*NIB*NO RESERVE!ORIG$390.00


$74.99


GARGOYLES ORIG ANIMATION PROD DRAWING ART 2 PCS NO RESERVE SEE PICS MAKE OFFER


GARGOYLES ORIG ANIMATION PROD DRAWING ART 2 PCS NO RESERVE SEE PICS MAKE OFFER


$75.00


BEAUTIFUL 5 LIGHT CHANDELIER*NIB*NO RESERVE!ORIG$425.00


BEAUTIFUL 5 LIGHT CHANDELIER*NIB*NO RESERVE!ORIG$425.00


$72.24


Swarovski Crystal WOLF ~ Mint ~ Orig Box ~ No Reserve


Swarovski Crystal WOLF ~ Mint ~ Orig Box ~ No Reserve


$69.00


ZEISS IKON IKOFLEX Vintage German 75mm F3.5 TLR Camera w/ orig. Box...No Reserve


ZEISS IKON IKOFLEX Vintage German 75mm F3.5 TLR Camera w/ orig. Box…No Reserve


$76.00


BIG DISPLAY BOTTLE


BIG DISPLAY BOTTLE “SCHENLEY RESERVE” ORIG 60s VINTAGE!


$63.48


Flex Force Cross Training System - Orig Workout & owner's manual - NO RESERVE !!


Flex Force Cross Training System – Orig Workout & owner’s manual – NO RESERVE !!


$75.00


Vintage Signed Wyang Goleck Puppet orig batik gown pre 1970 no reserve price


Vintage Signed Wyang Goleck Puppet orig batik gown pre 1970 no reserve price


$65.00


BEAUTIFUL KICHLER CHANDELIER*NIB*NO RESERVE!ORIG$402.00


BEAUTIFUL KICHLER CHANDELIER*NIB*NO RESERVE!ORIG$402.00


$59.49


Swarovski Crystal Kris Bear Picture Frame ~ No Reserve ~ Mint Cond ~ Orig Box


Swarovski Crystal Kris Bear Picture Frame ~ No Reserve ~ Mint Cond ~ Orig Box


$59.00


BEAUTIFUL KICHLER CHANDELIER*NIB*NO RESERVE*ORIG$320.00


BEAUTIFUL KICHLER CHANDELIER*NIB*NO RESERVE*ORIG$320.00


$49.99


SAE X-10A Hypersonic Class A Power Amplifier,Orig $800,No Reserve,Works Perfect


SAE X-10A Hypersonic Class A Power Amplifier,Orig $800,No Reserve,Works Perfect


$26.87


BRUSHED NICKEL CHANDELIER*NIB*NO RESERVE*ORIG $270.00


BRUSHED NICKEL CHANDELIER*NIB*NO RESERVE*ORIG $270.00


$44.99


NWT PUNK ROCK BABY DIAPER BAG LUXURY DOG PET CARRIER DUFFLE ORIG $155 NO RESERVE


NWT PUNK ROCK BABY DIAPER BAG LUXURY DOG PET CARRIER DUFFLE ORIG $155 NO RESERVE


$42.00


Rare ROLLING STONES Big Hits 1st. STEREO, GFC, ORIG. LONDON, NM!!! NO Reserve


Rare ROLLING STONES Big Hits 1st. STEREO, GFC, ORIG. LONDON, NM!!! NO Reserve


$49.99


Webra 416 SPEED RC  Airplane Engine w/Muffler ORIG BOX & STICKERS!NO RESERVE!


Webra 416 SPEED RC Airplane Engine w/Muffler ORIG BOX & STICKERS!NO RESERVE!


$41.00


AUTH. ORIG VTG MODERN LARGE BRASS 24


AUTH. ORIG VTG MODERN LARGE BRASS 24″ SPUTNIK CHANDELIER LIGHT 24 ARM No Reserve


$19.99


RARE 1987 Michael Jackson pets Bubbles the Chimp Orig Bx RARE HTF NO RESERVE


RARE 1987 Michael Jackson pets Bubbles the Chimp Orig Bx RARE HTF NO RESERVE


$49.99


android 2.2 8


android 2.2 8″ tablet M806S w/ orig. box, full hd free shipping NO RESERVE!


$48.00


NO RESERVE WOW! O'NEILL *POLARIZED* ORIG $137 SWEEPER SUNGLASSES: X-Ray Tortoise


NO RESERVE WOW! O’NEILL *POLARIZED* ORIG $137 SWEEPER SUNGLASSES: X-Ray Tortoise


$34.99


ESS EYE SAFETY SYSTEMS UCE NARO EYEGLASSES MINT W/ORIG CASE NO RESERVE


ESS EYE SAFETY SYSTEMS UCE NARO EYEGLASSES MINT W/ORIG CASE NO RESERVE


$39.00


6 WELL KNOWN PERFUME BOTTLES W/ORIG PERFUME BOUR JOIS,IGLESIAS & MORE NO RESERVE


6 WELL KNOWN PERFUME BOTTLES W/ORIG PERFUME BOUR JOIS,IGLESIAS & MORE NO RESERVE


$30.00


COLEMAN NORTH STAR ELECTRIC LANTERN MODEL 5359 MINT W/ORIG BOX NO RESERVE


COLEMAN NORTH STAR ELECTRIC LANTERN MODEL 5359 MINT W/ORIG BOX NO RESERVE


$25.00


WOMENS TALBOTS TRIXIE OXFORD W/ BUCKLE - SZ 10 NEW IN BOX - NO RESERVE Orig $88


WOMENS TALBOTS TRIXIE OXFORD W/ BUCKLE – SZ 10 NEW IN BOX – NO RESERVE Orig $88


$24.95


STAPLE GUN TACKER ARROW T-50 MINT W/ORIG BOX CHEAP NO RESERVE


STAPLE GUN TACKER ARROW T-50 MINT W/ORIG BOX CHEAP NO RESERVE


$25.00


VINTAGE JAPANESE CIGARRETTE LIGHTER MINT W/ORIG BOX NO RESERVE


VINTAGE JAPANESE CIGARRETTE LIGHTER MINT W/ORIG BOX NO RESERVE


$25.00


PRADA Womens Loafers Size 40 / 9 Excellent Condition Orig $349 NO RESERVE!!!!!!!


PRADA Womens Loafers Size 40 / 9 Excellent Condition Orig $349 NO RESERVE!!!!!!!


$20.50


CHARLES DAVID NO RESERVE! Black Suede / LEATHER ESPADRILLE SZ 5.5M ORIG $139


CHARLES DAVID NO RESERVE! Black Suede / LEATHER ESPADRILLE SZ 5.5M ORIG $139


$15.99


VINTAGE CUBS TIMEX WINDING WATCH CIRCA 1960'S W/ORIG BAND RUNS GREAT NO RESERVE


VINTAGE CUBS TIMEX WINDING WATCH CIRCA 1960′S W/ORIG BAND RUNS GREAT NO RESERVE


$25.00


Past, Present and THE FUTURES LP Orig promo Modern Soul wlp No Reserve Auction!


Past, Present and THE FUTURES LP Orig promo Modern Soul wlp No Reserve Auction!


$24.97


Orig Photo Detroit Reserve Officers training 1935


Orig Photo Detroit Reserve Officers training 1935


$28.88


1930 Federal Reserve Bank Chairman Orig Press Photo


1930 Federal Reserve Bank Chairman Orig Press Photo


$28.88


Orig Photo Detroit Reserve Officers Training Corps 1935


Orig Photo Detroit Reserve Officers Training Corps 1935


$28.88


5 GENERAL ELECTRIC POWERMITE FLASH BULBS M2 & OTHERS BULBS ORIG BOXES NO RESERVE


5 GENERAL ELECTRIC POWERMITE FLASH BULBS M2 & OTHERS BULBS ORIG BOXES NO RESERVE


$22.00


GINNY VOGUE DOLL BLACK 8


GINNY VOGUE DOLL BLACK 8″ W/ORIG BOX COMPLETE VG COND DATED 1986 NO RESERVE


$21.00


SENTRY WIRELESS H0900 HEADPHONE W/ORIG BOX NEVER USED MINT NO RESERVE


SENTRY WIRELESS H0900 HEADPHONE W/ORIG BOX NEVER USED MINT NO RESERVE


$20.00


2 VINTAGE COMPLETE ROSARIES W/ORIG BOXES VG COND NO RESERVE


2 VINTAGE COMPLETE ROSARIES W/ORIG BOXES VG COND NO RESERVE


$20.00


5 WELL KNOWN PERFUME BOTTLES W/ORIG PERFUME BVLGARI, RARE GOLD & MORE NO RESERVE


5 WELL KNOWN PERFUME BOTTLES W/ORIG PERFUME BVLGARI, RARE GOLD & MORE NO RESERVE


$17.00


Benny Golson I'm Always Dancin to Music LP Orig Promo No Reserve Auc funk soul


Benny Golson I’m Always Dancin to Music LP Orig Promo No Reserve Auc funk soul


$17.99


CARDINAL DOUBLE NINE COLOR DOT DOMINOES SEALED W/ORIG BOX CHEAP NO RESERVE


CARDINAL DOUBLE NINE COLOR DOT DOMINOES SEALED W/ORIG BOX CHEAP NO RESERVE


$15.00


BEAUTIFUL KICHLER WALL SCONCE*NIB*NO RESERVE!ORIG$60.00


BEAUTIFUL KICHLER WALL SCONCE*NIB*NO RESERVE!ORIG$60.00


$19.99


CRAFTSMAN 13 INCHES TOOL BAG MINT W/ORIG TAG NEVER USED CHEAP NO RESERVE


CRAFTSMAN 13 INCHES TOOL BAG MINT W/ORIG TAG NEVER USED CHEAP NO RESERVE


$15.00



Post a Comment

Your email is never shared. Required fields are marked *

*
*