| Convert to LVM for the rootvg on local drive | | | | Creating journal (32768 blocks): done |
| | | | | Writing superblocks and filesystem accounting |
| 1. Check the current setup | | | | information: done |
| | | | | |
| [root@lab1 ~]# df -h | | | | This filesystem will be automatically checked every |
| Filesystem Size Used Avail Use% | | | | 37 mounts or |
| Mounted on | | | | 180 days, whichever comes first. Use tune2fs -c or |
| 1. /dev/cciss/c0d0p1 18G 2.9G 14G | | | | -i to override. |
| 18% /tmpfs 1005M 0 | | | | |
| 1005M 0% /dev/shm | | | | |
| | | | | 13. Delete everything in the original /boot filesystem |
| [root@lab1 ~]# fdisk -l /dev/cciss/c0d0 | | | | on the temporary partition. |
| | | | | |
| Disk /dev/cciss/c0d0: 73.3 GB, 73372631040 bytes | | | | [root@lab1 mnt]# cd /boot |
| 255 heads, 63 sectors/track, 8920 cylinders | | | | [root@lab1 boot]# ls |
| Units = cylinders of 16065 * 512 = 8225280 bytes | | | | 1. config-2.6.18-92.el5 initrd-2.6.18-92.el5.img |
| | | | | symvers-2.6.18-92.el5.gz |
| Device Boot | | | | vmlinuz-2.6.18-92.el5grub |
| Start End Blocks Id System | | | | initrd-2.6.18-92.el5.img.orig System.map-2.6.18-92.el5 |
| /dev/cciss/c0d0p1 * 1 | | | | [root@lab1 boot]# rm -f -r * |
| 2350 18876343+ 83 Linux | | | | |
| /dev/cciss/c0d0p2 2351 | | | | 14. Mount slice 1 onto /boot and untar the contents. |
| 3394 8385930 82 Linux swap / Solaris | | | | |
| | | | | [root@lab1 /]# mount -t ext3 /dev/cciss/c0d0p1 |
| 1. Remove the current swap space to make room | | | | boot |
| for a temporary root partition | | | | [root@lab1 /]# cd /boot |
| | | | | [root@lab1 boot]# tar -xvf /tmp |
| [root@lab1 ~]# swapoff -a -v | | | | boot.tarconfig-2.6.18-92.el5grub/grub |
| [root@lab1 ~]# fdisk /dev/cciss/c0d0 | | | | minix_stage1_5grub/jfs_stage1_5grub |
| | | | | device.mapgrub/splash.xpm.gzgrub/fat_stage1_5grub |
| The number of cylinders for this disk is set to 8920. | | | | e2fs_stage1_5grub/ffs_stage1_5grub |
| There is nothing wrong with that, but this is larger | | | | xfs_stage1_5grub/ufs2_stage1_5grub |
| than 1024,and could in certain setups cause problems | | | | iso9660_stage1_5grub/vstafs_stage1_5grub |
| with: | | | | stage1grub/grub.confgrub/reiserfs_stage1_5grub |
| 1) software that runs at boot time (e.g., old versions | | | | menu.lstgrub |
| of LILO) | | | | vers-2.6.18-92.el5.gz |
| 2) booting and partitioning software from other OSs | | | | System.map-2.6.18-92.el5vmlinuz-2.6.18-92.el5 |
| (e.g., DOS FDISK, OS/2 FDISK) | | | | [root@lab1 boot]# pwd |
| | | | | /boot |
| Command (m for help): d | | | | [root@lab1 boot]# ls |
| Partition number (1-4): 2 | | | | 1. config-2.6.18-92.el5 initrd-2.6.18-92.el5.img |
| | | | | lost+found |
| Command (m for help): p | | | | System.map-2.6.18-92.el5grub |
| | | | | initrd-2.6.18-92.el5.img.orig symvers-2.6.18-92.el5.gz |
| Disk /dev/cciss/c0d0: 73.3 GB, 73372631040 bytes | | | | vmlinuz-2.6.18-92.el5 |
| 255 heads, 63 sectors/track, 8920 cylinders | | | | |
| Units = cylinders of 16065 * 512 = 8225280 bytes | | | | 15. Change /etc/fstab to point to the new /boot |
| | | | | partition. |
| Device Boot | | | | |
| Start End Blocks Id System | | | | [root@lab1 boot]# vi /etc/fstab |
| /dev/cciss/c0d0p1 * 1 | | | | [root@lab1 boot]# cat /etc/fstab |
| 2350 18876343+ 83 Linux | | | | /dev/cciss/c0d0p3 |
| | | | | ext3 |
| Command (m for help): w | | | | defaults 1 1 |
| The partition table has been altered! | | | | /dev/cciss/c0d0p1 /boot |
| | | | | ext3 defaults 1 |
| Calling ioctl() to re-read partition table. | | | | 2tmpfs /dev |
| | | | | shm tmpfs |
| WARNING: Re-reading the partition table failed with | | | | defaults 0 |
| error 16: Device or resource busy. | | | | 0devpts /dev |
| The kernel still uses the old table. | | | | pts devpts |
| The new table will be used at the next reboot. | | | | gid=5,mode=620 0 |
| Syncing disks. | | | | 0sysfs |
| [root@lab1 ~]# partprobe | | | | sys sysfs |
| | | | | defaults 0 0proc |
| 1. Make sure to leave enough room, so that you can | | | | |
| create /boot partition on slice 1, since /boot can not | | | | proc proc |
| be under LVM support. | | | | defaults 0 0 |
| | | | | |
| [root@lab1 ~]# fdisk /dev/cciss/c0d0 | | | | 16. Recreate the intitrd image. |
| Command (m for help): p | | | | |
| | | | | [root@lab1 ~]# mkinitrd -f /boot/initrd-2.6.18-92.el5.img |
| Disk /dev/cciss/c0d0: 73.3 GB, 73372631040 bytes | | | | `uname -r` |
| 255 heads, 63 sectors/track, 8920 cylinders | | | | |
| Units = cylinders of 16065 * 512 = 8225280 bytes | | | | 17. Create a new MBR for the new /boot partition. |
| | | | | |
| Device Boot | | | | [root@lab1 /]# grub-install /dev/cciss/c0d0 |
| Start End Blocks Id System | | | | Installation finished. No error reported. |
| /dev/cciss/c0d0p1 * 1 | | | | This is the contents of the device map /boot/grub |
| 2350 18876343+ 83 Linux | | | | device.map. |
| | | | | Check if this is correct or not. If any of the lines is |
| Command (m for help): n | | | | incorrect,fix it and re-run the script `grub-install'. |
| Command action | | | | |
| e extended | | | | # this device map was generated by anaconda |
| p primary partition (1-4)p | | | | (hd0) /dev/cciss/c0d0 |
| Partition number (1-4): 3 | | | | |
| First cylinder (2351-8920, default 2351): 2371 | | | | 18. Remove the /boot references in the /boot/grub |
| Last cylinder or +size or +sizeM or +sizeK | | | | grub.conf file. |
| (2371-8920, default 8920): 4721 | | | | |
| | | | | [root@lab1 ~]# vi /boot/grub/grub.conf |
| Command (m for help): w | | | | [root@lab1 ~]# cat /boot/grub/grub.conf |
| The partition table has been altered! | | | | # grub.conf generated by anaconda |
| | | | | # |
| Calling ioctl() to re-read partition table. | | | | # Note that you do not have to rerun grub after |
| | | | | making changes to this file |
| WARNING: Re-reading the partition table failed with | | | | # NOTICE: You do not have a /boot partition. |
| error 16: Device or resource busy. | | | | This means that |
| The kernel still uses the old table. | | | | # all kernel and initrd paths are relative |
| The new table will be used at the next reboot. | | | | to /, eg. |
| Syncing disks. | | | | # root (hd0,0) |
| [root@lab1 ~]# partprobe | | | | # kernel /boot/vmlinuz-version ro |
| | | | | root=/dev/cciss/c0d0p1 |
| 1. Create a filesystem on the new slice, and copy the | | | | # initrd /boot/initrd-version.img |
| contents of slice 1 over. | | | | #boot=/dev/cciss |
| | | | | c0d0default=0timeout=5splashimage=(hd0,0)/grub |
| [root@lab1 ~]# mke2fs -j /dev/cciss/c0d0p3mke2fs | | | | splash.xpm.gzhiddenmenutitle Red Hat Enterprise Linux |
| 1.39 (29-May-2006) | | | | Server (2.6.18-92.el5) |
| Filesystem label= | | | | root (hd0,0) |
| OS type: Linux | | | | kernel /vmlinuz-2.6.18-92.el5 ro root=/dev |
| Block size=4096 (log=2) | | | | cciss/c0d0p3 pci=nommconf rhgb quiet |
| Fragment size=4096 (log=2) | | | | initrd /initrd-2.6.18-92.el5.img |
| 2361760 inodes, 4721101 blocks | | | | |
| 236055 blocks (5.00%) reserved for the super user | | | | 19. Reboot, and it will boot off the new /boot |
| First data block=0 | | | | partition. |
| Maximum filesystem blocks=4294967296 | | | | |
| 145 block groups | | | | [root@lab1 ~]# df -k |
| 32768 blocks per group, 32768 fragments per group | | | | Filesystem 1K-blocks Used |
| 16288 inodes per group | | | | Available Use% Mounted on |
| Superblock backups stored on blocks: | | | | /dev/cciss/c0d0p3 18587892 2984528 |
| 32768, 98304, 163840, 229376, 294912, | | | | 14659144 17% / |
| 819200, 884736, 1605632, 2654208, | | | | /dev/cciss/c0d0p1 155543 15571 |
| 4096000 | | | | 131942 11% /boottmpfs |
| | | | | 1029044 0 1029044 0% /dev |
| Writing inode tables: | | | | shm |
| done | | | | |
| Creating journal (32768 blocks): done | | | | 20. Initialize the LVM |
| Writing superblocks and filesystem accounting | | | | |
| information: done | | | | [root@lab1 /]# vgscan |
| | | | | Reading all physical volumes. This may take a |
| This filesystem will be automatically checked every | | | | while... |
| 37 mounts or | | | | Found volume group "uservg" using metadata type |
| 180 days, whichever comes first. Use tune2fs -c or | | | | lvm2 |
| -i to override. | | | | |
| [root@lab1 ~]# mount -t ext3 /dev/cciss/c0d0p3 | | | | 21. Create a physical volume on partition 2 that was |
| mnt | | | | created earlier. |
| [root@lab1 ~]# cd / | | | | |
| [root@lab1 /]# find / -xdev|cpio -pvmd /mnt | | | | [root@lab1 /]# pvcreate /dev/cciss/c0d0p2 |
| | | | | Physical volume "/dev/cciss/c0d0p2" successfully |
| 1. Make the new partition bootable. | | | | created |
| | | | | |
| [root@lab1 /]# fdisk /dev/cciss/c0d0 | | | | 22. Create the root volume group on the partition |
| | | | | just created. |
| The number of cylinders for this disk is set to 8920. | | | | |
| There is nothing wrong with that, but this is larger | | | | [root@lab1 /]# vgcreate rootvg /dev/cciss/c0d0p2 |
| than 1024,and could in certain setups cause problems | | | | Volume group "rootvg" successfully created |
| with: | | | | |
| 1) software that runs at boot time (e.g., old versions | | | | 23. Create a logical volume for the new root volume |
| of LILO) | | | | group. |
| 2) booting and partitioning software from other OSs | | | | |
| (e.g., DOS FDISK, OS/2 FDISK) | | | | [root@lab1 /]# lvcreate -n lv00 --size 18G rootvg |
| | | | | Logical volume "lv00" created |
| Command (m for help): p | | | | |
| | | | | 24. Create a filesystem on the new logical volume. |
| Disk /dev/cciss/c0d0: 73.3 GB, 73372631040 bytes | | | | |
| 255 heads, 63 sectors/track, 8920 cylinders | | | | [root@lab1 /]# mke2fs -j /dev/rootvg/lv00mke2fs |
| Units = cylinders of 16065 * 512 = 8225280 bytes | | | | 1.39 (29-May-2006) |
| | | | | Filesystem label= |
| Device Boot | | | | OS type: Linux |
| Start End Blocks Id System | | | | Block size=4096 (log=2) |
| /dev/cciss/c0d0p1 * 1 | | | | Fragment size=4096 (log=2) |
| 2350 18876343+ 83 Linux | | | | 2359296 inodes, 4718592 blocks |
| /dev/cciss/c0d0p3 2371 | | | | 235929 blocks (5.00%) reserved for the super user |
| 4721 18884407+ 83 Linux | | | | First data block=0 |
| | | | | Maximum filesystem blocks=4294967296 |
| Command (m for help): a | | | | 144 block groups |
| Partition number (1-4): 3 | | | | 32768 blocks per group, 32768 fragments per group |
| | | | | 16384 inodes per group |
| Command (m for help): a | | | | Superblock backups stored on blocks: |
| Partition number (1-4): 1 | | | | 32768, 98304, 163840, 229376, 294912, |
| | | | | 819200, 884736, 1605632, 2654208, |
| Command (m for help): p | | | | 4096000 |
| | | | | |
| Disk /dev/cciss/c0d0: 73.3 GB, 73372631040 bytes | | | | Writing inode tables: |
| 255 heads, 63 sectors/track, 8920 cylinders | | | | done |
| Units = cylinders of 16065 * 512 = 8225280 bytes | | | | Creating journal (32768 blocks): done |
| | | | | Writing superblocks and filesystem accounting |
| Device Boot | | | | information: done |
| Start End Blocks Id System | | | | |
| /dev/cciss/c0d0p1 1 | | | | This filesystem will be automatically checked every |
| 2350 18876343+ 83 Linux | | | | 29 mounts or |
| /dev/cciss/c0d0p3 * 2371 | | | | 180 days, whichever comes first. Use tune2fs -c or |
| 4721 18884407+ 83 Linux | | | | -i to override. |
| | | | | |
| Command (m for help): w | | | | 25. Mount the new filesystem and copy the root files |
| The partition table has been altered! | | | | over. |
| | | | | |
| Calling ioctl() to re-read partition table. | | | | [root@lab1 /]# mount -t ext3 /dev/rootvg/lv00 /mnt |
| | | | | [root@lab1 /]# cd / |
| WARNING: Re-reading the partition table failed with | | | | [root@lab1 /]# find / -xdev | cpio -pvmd /mnt |
| error 16: Device or resource busy. | | | | …….. |
| The kernel still uses the old table. | | | | /mnt/usr/include/gnome-desktop-2.0/libgnomeui |
| The new table will be used at the next reboot. | | | | /mnt/usr/include/gnome-desktop-2.0/libgnomeui |
| Syncing disks. | | | | gnome-ditem-edit.h |
| [root@lab1 /]# partprobe | | | | /mnt/usr/include/gnome-desktop-2.0/libgnomeui |
| | | | | gnome-hint.h |
| 1. Edit the /mnt/etc/fstab file to point to the new | | | | /mnt/usr/include/mpfr.h |
| partition. | | | | /mnt/usr/include/ftw.h |
| | | | | /mnt/usr/include/spawn.h |
| [root@lab1 /]# vi /mnt/etc/fstab | | | | /mnt/lost+found |
| [root@lab1 /]# cat /mnt/etc/fstab | | | | 5030570 blocks |
| /dev/cciss/c0d0p3 | | | | [root@lab1 /]# |
| ext3 | | | | |
| defaults 1 | | | | 26. Recreate the initrd image. |
| 1tmpfs /dev | | | | |
| shm tmpfs | | | | [root@lab1 /]# mkinitrd –f /boot |
| defaults 0 | | | | initrd-2.6.18-92.el5.img `uname –r` |
| 0devpts /dev | | | | |
| pts devpts | | | | 27. Make sure the initrd image is configured for LVM. |
| gid=5,mode=620 0 | | | | |
| 0sysfs | | | | [root@lab1 /]# cd /tmp |
| sys sysfs | | | | [root@lab1 tmp]# mkdir working-intitrd |
| defaults 0 | | | | [root@lab1 tmp]# cd working-intitrd |
| 0proc | | | | [root@lab1 working-intitrd]# zcat /boot |
| proc proc | | | | initrd-2.6.18-92.el5.img|cpio -i |
| defaults 0 0 | | | | 17771 blocks |
| [root@lab1 /]# | | | | [root@lab1 working-intitrd]# ls bin/lvmbin/lvm |
| | | | | [root@lab1 working-intitrd]# ls etc/lvmlvm.conf |
| 1. Edit the /mnt/boot/grub/grub.conf and /boot/grub | | | | |
| grub.conf file to point to the new partition also. | | | | |
| | | | | 28. If the image does not LVM support it can be |
| [root@lab1 /]# vi /mnt/boot/grub/grub.conf | | | | added this way. |
| [root@lab1 /]# cat /mnt/boot/grub/grub.conf | | | | |
| # grub.conf generated by anaconda | | | | [root@lab1 working-intitrd]# cp -r /etc/lvm etc/cp: |
| # | | | | overwrite `etc/lvm/backup/rootvg'? ycp: overwrite |
| # Note that you do not have to rerun grub after | | | | `etc/lvm/backup/uservg'? ycp: overwrite `etc/lvm |
| making changes to this file | | | | archive/rootvg_00001.vg'? ycp: overwrite `etc/lvm |
| # NOTICE: You do not have a /boot partition. | | | | archive/uservg_00000.vg'? ycp: overwrite `etc/lvm |
| This means that | | | | archive/rootvg_00000.vg'? ycp: overwrite `etc/lvm |
| # all kernel and initrd paths are relative | | | | lvm.conf.default'? ycp: overwrite `etc/lvm/cache |
| to /, eg. | | | | .cache'? ycp: overwrite `etc/lvm/lvm.conf'? y |
| # root (hd0,0) | | | | [root@lab1 working-intitrd]# pwd |
| # kernel /boot/vmlinuz-version ro | | | | /tmp/working-intitrd |
| root=/dev/cciss/c0d0p1 | | | | [root@lab1 working-intitrd]# ls etc/lvm/archive |
| # initrd /boot/initrd-version.img | | | | backup cache lvm.conf lvm.conf.default |
| #boot=/dev/cciss | | | | [root@lab1 working-intitrd]# pwd |
| c0d0default=0timeout=5splashimage=(hd0,0)/boot | | | | /tmp/working-intitrd |
| grub/splash.xpm.gzhiddenmenutitle Red Hat Enterprise | | | | [root@lab1 working-intitrd]# find . -print | cpio -o -c |
| Linux Server (2.6.18-92.el5) | | | | |gzip -9 > /tmp/initrd-2.6.18-92.el5.img |
| root (hd0,0) | | | | 17817 blocks |
| kernel /boot/vmlinuz-2.6.18-92.el5 ro root= | | | | |
| dev/cciss/c0d0p3 pci=nommconf rhgb quiet | | | | [root@lab1 working-intitrd]# cp /boot |
| initrd /boot/initrd-2.6.18-92.el5.img | | | | initrd-2.6.18-92.el5.img /boot/initrd-2.6.18-92.el5.img.bak |
| [root@lab1 /]# vi /boot/grub/grub.conf | | | | [root@lab1 working-intitrd]# ls -l /boot |
| [root@lab1 /]# cat /boot/grub/grub.conf | | | | initrd-2.6.18-92.el5.img.bak /tmp/initrd-2.6.18-92.el5.img |
| # grub.conf generated by anaconda | | | | -rw------- 1 root root 3713844 May 20 15:23 /boot |
| # | | | | initrd-2.6.18-92.el5.img.bak |
| # Note that you do not have to rerun grub after | | | | -rw-r--r-- 1 root root 3716171 May 20 15:22 /tmp |
| making changes to this file | | | | initrd-2.6.18-92.el5.img |
| # NOTICE: You do not have a /boot partition. | | | | [root@lab1 working-intitrd]# cp /boot |
| This means that | | | | initrd-2.6.18-92.el5.img.bak /boot/initrd-2.6.18-92.el5.img |
| # all kernel and initrd paths are relative | | | | |
| to /, eg. | | | | 29. Edit the /mnt/etc/fstab to reflect the new |
| # root (hd0,0) | | | | rootvg volume group |
| # kernel /boot/vmlinuz-version ro | | | | |
| root=/dev/cciss/c0d0p1 | | | | [root@lab1 /]# vi /mnt/etc/fstab |
| # initrd /boot/initrd-version.img | | | | [root@lab1 /]# cat /mnt/etc/fstab |
| #boot=/dev/cciss | | | | /dev/rootvg/lv00 |
| c0d0default=0timeout=5splashimage=(hd0,0)/boot | | | | ext3 |
| grub/splash.xpm.gzhiddenmenutitle Red Hat Enterprise | | | | defaults 1 1 |
| Linux Server (2.6.18-92.el5) | | | | /dev/cciss/c0d0p1 /boot |
| root (hd0,0) | | | | ext3 defaults 1 |
| kernel /boot/vmlinuz-2.6.18-92.el5 ro root= | | | | 2tmpfs /dev |
| dev/cciss/c0d0p3 pci=nommconf rhgb quiet | | | | shm tmpfs |
| initrd /boot/initrd-2.6.18-92.el5.img | | | | defaults 0 |
| | | | | 0devpts /dev |
| 1. Reboot the server, and it should come up on the | | | | pts devpts |
| new partition. | | | | gid=5,mode=620 0 |
| | | | | 0sysfs |
| [root@lab1 ~]# df -k | | | | sys sysfs |
| Filesystem 1K-blocks Used | | | | defaults 0 0proc |
| Available Use% Mounted on | | | | |
| /dev/cciss/c0d0p3 18587892 2984316 | | | | proc proc |
| 14659356 17% /tmpfs | | | | defaults 0 0 |
| 1029044 0 1029044 0% /dev | | | | |
| shm | | | | 30. Edit the /boot/grub/grub.conf to point to the new |
| | | | | rootvg |
| 1. Remove slice 1 and create a /boot partition on slice | | | | |
| 1, and the new root partition on slice 2. | | | | [root@lab1 /]# vi /boot/grub/grub.conf |
| | | | | [root@lab1 /]# cat /boot/grub/grub.conf |
| [root@lab1 ~]# fdisk /dev/cciss/c0d0 | | | | # grub.conf generated by anaconda |
| Command (m for help): p | | | | # |
| | | | | # Note that you do not have to rerun grub after |
| Disk /dev/cciss/c0d0: 73.3 GB, 73372631040 bytes | | | | making changes to this file |
| 255 heads, 63 sectors/track, 8920 cylinders | | | | # NOTICE: You do not have a /boot partition. |
| Units = cylinders of 16065 * 512 = 8225280 bytes | | | | This means that |
| | | | | # all kernel and initrd paths are relative |
| Device Boot | | | | to /, eg. |
| Start End Blocks Id System | | | | # root (hd0,0) |
| /dev/cciss/c0d0p1 1 | | | | # kernel /boot/vmlinuz-version ro |
| 2350 18876343+ 83 Linux | | | | root=/dev/cciss/c0d0p1 |
| /dev/cciss/c0d0p3 * 2371 | | | | # initrd /boot/initrd-version.img |
| 4721 18884407+ 83 Linux | | | | #boot=/dev/cciss |
| | | | | c0d0default=0timeout=5splashimage=(hd0,0)/grub |
| Command (m for help): d | | | | splash.xpm.gzhiddenmenutitle Red Hat Enterprise Linux |
| Partition number (1-4): 1 | | | | Server (2.6.18-92.el5) |
| | | | | root (hd0,0) |
| Command (m for help): w | | | | kernel /vmlinuz-2.6.18-92.el5 ro root=/dev |
| The partition table has been altered! | | | | rootvg/lv00 pci=nommconf rhgb quiet |
| | | | | initrd /initrd-2.6.18-92.el5.img |
| Calling ioctl() to re-read partition table. | | | | |
| | | | | 31. Run grub-install to recreate the MBR. |
| WARNING: Re-reading the partition table failed with | | | | |
| error 16: Device or resource busy. | | | | [root@lab1 /]# grub-install /dev/cciss/c0d0 |
| The kernel still uses the old table. | | | | Installation finished. No error reported. |
| The new table will be used at the next reboot. | | | | This is the contents of the device map /boot/grub |
| | | | | device.map. |
| [root@lab1 ~]# fdisk /dev/cciss/c0d0 | | | | Check if this is correct or not. If any of the lines is |
| | | | | incorrect,fix it and re-run the script `grub-install'. |
| The number of cylinders for this disk is set to 8920. | | | | |
| There is nothing wrong with that, but this is larger | | | | # this device map was generated by anaconda |
| than 1024,and could in certain setups cause problems | | | | (hd0) /dev/cciss/c0d0 |
| with: | | | | |
| 1) software that runs at boot time (e.g., old versions | | | | 32. Reboot, and it should come up under LVM |
| of LILO) | | | | support. |
| 2) booting and partitioning software from other OSs | | | | |
| (e.g., DOS FDISK, OS/2 FDISK) | | | | [root@lab1 ~]# df -k |
| | | | | Filesystem 1K-blocks Used |
| Command (m for help): p | | | | Available Use% Mounted on |
| | | | | /dev/mapper/rootvg-lv00 |
| Disk /dev/cciss/c0d0: 73.3 GB, 73372631040 bytes | | | | 18578172 |
| 255 heads, 63 sectors/track, 8920 cylinders | | | | 2984604 14649852 17% / |
| Units = cylinders of 16065 * 512 = 8225280 bytes | | | | /dev/cciss/c0d0p1 155543 19214 |
| | | | | 128299 14% /boottmpfs |
| Device Boot | | | | 1029044 0 1029044 |
| Start End Blocks Id System | | | | 0% /dev/shm |
| /dev/cciss/c0d0p3 * 2371 | | | | |
| 4721 18884407+ 83 Linux | | | | 33. Delete the temporary root partition 3. |
| | | | | |
| Command (m for help): n | | | | [root@lab1 ~]# fdisk /dev/cciss/c0d0 |
| Command action | | | | |
| e extended | | | | The number of cylinders for this disk is set to 8920. |
| p primary partition (1-4)p | | | | There is nothing wrong with that, but this is larger |
| Partition number (1-4): 1 | | | | than 1024,and could in certain setups cause problems |
| First cylinder (1-8920, default 1): | | | | with: |
| Using default value 1 | | | | 1) software that runs at boot time (e.g., old versions |
| Last cylinder or +size or +sizeM or +sizeK (1-2370, | | | | of LILO) |
| default 2370): 20 | | | | 2) booting and partitioning software from other OSs |
| | | | | (e.g., DOS FDISK, OS/2 FDISK) |
| Command (m for help): p | | | | |
| | | | | Command (m for help): p |
| Disk /dev/cciss/c0d0: 73.3 GB, 73372631040 bytes | | | | |
| 255 heads, 63 sectors/track, 8920 cylinders | | | | Disk /dev/cciss/c0d0: 73.3 GB, 73372631040 bytes |
| Units = cylinders of 16065 * 512 = 8225280 bytes | | | | 255 heads, 63 sectors/track, 8920 cylinders |
| | | | | Units = cylinders of 16065 * 512 = 8225280 bytes |
| Device Boot | | | | |
| Start End Blocks Id System | | | | Device Boot |
| /dev/cciss/c0d0p1 1 | | | | Start End Blocks Id System |
| 20 160618+ 83 Linux | | | | /dev/cciss/c0d0p1 * |
| /dev/cciss/c0d0p3 * 2371 | | | | 1 20 160618+ 83 Linux |
| 4721 18884407+ 83 Linux | | | | /dev/cciss/c0d0p2 21 |
| | | | | 2370 18876375 8e Linux LVM |
| Command (m for help): n | | | | /dev/cciss/c0d0p3 2371 |
| Command action | | | | 4721 18884407+ 83 Linux |
| e extended | | | | |
| p primary partition (1-4)p | | | | Command (m for help): d |
| Partition number (1-4): 2 | | | | Partition number (1-4): 3 |
| First cylinder (21-8920, default 21): 21 | | | | |
| Last cylinder or +size or +sizeM or +sizeK (21-2370, | | | | Command (m for help): w |
| default 2370): 2370 | | | | The partition table has been altered! |
| | | | | |
| Command (m for help): p | | | | Calling ioctl() to re-read partition table. |
| | | | | |
| Disk /dev/cciss/c0d0: 73.3 GB, 73372631040 bytes | | | | WARNING: Re-reading the partition table failed with |
| 255 heads, 63 sectors/track, 8920 cylinders | | | | error 16: Device or resource busy. |
| Units = cylinders of 16065 * 512 = 8225280 bytes | | | | The kernel still uses the old table. |
| | | | | The new table will be used at the next reboot. |
| Device Boot | | | | Syncing disks. |
| Start End Blocks Id System | | | | [root@lab1 ~]# partprobe |
| /dev/cciss/c0d0p1 | | | | |
| 1 20 160618+ 83 Linux | | | | 34. Create a swap partition. |
| /dev/cciss/c0d0p2 21 | | | | |
| 2370 18876375 83 Linux | | | | [root@lab1 ~]# fdisk /dev/cciss/c0d0 |
| /dev/cciss/c0d0p3 * 2371 | | | | |
| 4721 18884407+ 83 Linux | | | | The number of cylinders for this disk is set to 8920. |
| | | | | There is nothing wrong with that, but this is larger |
| Command (m for help): w | | | | than 1024,and could in certain setups cause problems |
| The partition table has been altered! | | | | with: |
| | | | | 1) software that runs at boot time (e.g., old versions |
| Calling ioctl() to re-read partition table. | | | | of LILO) |
| | | | | 2) booting and partitioning software from other OSs |
| WARNING: Re-reading the partition table failed with | | | | (e.g., DOS FDISK, OS/2 FDISK) |
| error 16: Device or resource busy. | | | | |
| The kernel still uses the old table. | | | | Command (m for help): p |
| The new table will be used at the next reboot. | | | | |
| Syncing disks. | | | | Disk /dev/cciss/c0d0: 73.3 GB, 73372631040 bytes |
| [root@lab1 ~]# partprobe | | | | 255 heads, 63 sectors/track, 8920 cylinders |
| | | | | Units = cylinders of 16065 * 512 = 8225280 bytes |
| 10. Change the partition type of 2 to LVM (8e) and | | | | |
| make the partition 1 bootable. | | | | Device Boot |
| | | | | Start End Blocks Id System |
| [root@lab1 ~]# fdisk /dev/cciss/c0d0 | | | | /dev/cciss/c0d0p1 * |
| | | | | 1 20 160618+ 83 Linux |
| The number of cylinders for this disk is set to 8920. | | | | /dev/cciss/c0d0p2 21 |
| There is nothing wrong with that, but this is larger | | | | 2370 18876375 8e Linux LVM |
| than 1024,and could in certain setups cause problems | | | | |
| with: | | | | Command (m for help): n |
| 1) software that runs at boot time (e.g., old versions | | | | Command action |
| of LILO) | | | | e extended |
| 2) booting and partitioning software from other OSs | | | | p primary partition (1-4)p |
| (e.g., DOS FDISK, OS/2 FDISK) | | | | Partition number (1-4): 3 |
| | | | | First cylinder (2371-8920, default 2371): 2371 |
| Command (m for help): p | | | | Last cylinder or +size or +sizeM or +sizeK |
| | | | | (2371-8920, default 8920): +8192M |
| Disk /dev/cciss/c0d0: 73.3 GB, 73372631040 bytes | | | | |
| 255 heads, 63 sectors/track, 8920 cylinders | | | | Command (m for help): p |
| Units = cylinders of 16065 * 512 = 8225280 bytes | | | | |
| | | | | Disk /dev/cciss/c0d0: 73.3 GB, 73372631040 bytes |
| Device Boot | | | | 255 heads, 63 sectors/track, 8920 cylinders |
| Start End Blocks Id System | | | | Units = cylinders of 16065 * 512 = 8225280 bytes |
| /dev/cciss/c0d0p1 | | | | |
| 1 20 160618+ 83 Linux | | | | Device Boot |
| /dev/cciss/c0d0p2 21 | | | | Start End Blocks Id System |
| 2370 18876375 83 Linux | | | | /dev/cciss/c0d0p1 * |
| /dev/cciss/c0d0p3 * 2371 | | | | 1 20 160618+ 83 Linux |
| 4721 18884407+ 83 Linux | | | | /dev/cciss/c0d0p2 21 |
| | | | | 2370 18876375 8e Linux LVM |
| Command (m for help): t | | | | /dev/cciss/c0d0p3 2371 |
| Partition number (1-4): 2 | | | | 3367 8008402+ 83 Linux |
| Hex code (type L to list codes): 8e | | | | |
| Changed system type of partition 2 to 8e (Linux | | | | Command (m for help): t |
| LVM) | | | | Partition number (1-4): 82 |
| | | | | Value out of range. |
| Command (m for help): a | | | | Partition number (1-4): p |
| Partition number (1-4): 1 | | | | Partition number (1-4): 3 |
| | | | | Hex code (type L to list codes): 82 |
| Command (m for help): a | | | | Changed system type of partition 3 to 82 (Linux |
| Partition number (1-4): 3 | | | | swap / Solaris) |
| | | | | |
| Command (m for help): p | | | | Command (m for help): p |
| | | | | |
| Disk /dev/cciss/c0d0: 73.3 GB, 73372631040 bytes | | | | Disk /dev/cciss/c0d0: 73.3 GB, 73372631040 bytes |
| 255 heads, 63 sectors/track, 8920 cylinders | | | | 255 heads, 63 sectors/track, 8920 cylinders |
| Units = cylinders of 16065 * 512 = 8225280 bytes | | | | Units = cylinders of 16065 * 512 = 8225280 bytes |
| | | | | |
| Device Boot | | | | Device Boot |
| Start End Blocks Id System | | | | Start End Blocks Id System |
| /dev/cciss/c0d0p1 * | | | | /dev/cciss/c0d0p1 * |
| 1 20 160618+ 83 Linux | | | | 1 20 160618+ 83 Linux |
| /dev/cciss/c0d0p2 21 | | | | /dev/cciss/c0d0p2 21 |
| 2370 18876375 8e Linux LVM | | | | 2370 18876375 8e Linux LVM |
| /dev/cciss/c0d0p3 2371 | | | | /dev/cciss/c0d0p3 2371 |
| 4721 18884407+ 83 Linux | | | | 3367 8008402+ 82 Linux swap / Solaris |
| | | | | |
| Command (m for help): w | | | | Command (m for help): w |
| The partition table has been altered! | | | | The partition table has been altered! |
| | | | | |
| Calling ioctl() to re-read partition table. | | | | Calling ioctl() to re-read partition table. |
| | | | | |
| WARNING: Re-reading the partition table failed with | | | | WARNING: Re-reading the partition table failed with |
| error 16: Device or resource busy. | | | | error 16: Device or resource busy. |
| The kernel still uses the old table. | | | | The kernel still uses the old table. |
| The new table will be used at the next reboot. | | | | The new table will be used at the next reboot. |
| Syncing disks. | | | | Syncing disks. |
| [root@lab1 ~]# partprobe | | | | [root@lab1 ~]# partprobe |
| | | | | |
| 11. tar the contents of the original /boot dir. | | | | 35. Create swap space on the partition. |
| | | | | |
| [root@lab1 /]# cd /boot | | | | [root@lab1 ~]# mkswap /dev/cciss/c0d0p3 |
| [root@lab1 boot]# tar -cvf /tmp/boot.tar | | | | Setting up swapspace version 1, size = 8200597 kB |
| *config-2.6.18-92.el5grub/grub/stage2grub | | | | [root@lab1 ~]# vi /etc/fstab |
| fat_stage1_5grub/ufs2_stage1_5grub | | | | [root@lab1 ~]# cat /etc/fstab |
| ffs_stage1_5grub/menu.lstgrub/jfs_stage1_5grub | | | | /dev/rootvg/lv00 |
| splash.xpm.gzgrub/xfs_stage1_5grub | | | | ext3 |
| reiserfs_stage1_5grub/grub.confgrub/stage1grub | | | | defaults 1 1 |
| iso9660_stage1_5grub/device.mapgrub | | | | /dev/cciss/c0d0p1 /boot |
| e2fs_stage1_5grub/minix_stage1_5grub | | | | ext3 defaults 1 |
| img.origsymvers-2.6.18-92.el5.gz | | | | 2tmpfs /dev |
| System.map-2.6.18-92.el5vmlinuz-2.6.18-92.el5 | | | | shm tmpfs |
| | | | | defaults 0 |
| 12. Create a new filesystem on slice 1 , the new boot | | | | 0devpts /dev |
| partition. | | | | pts devpts |
| | | | | gid=5,mode=620 0 |
| [root@lab1 /]# mke2fs -j/dev/cciss/c0d0p1mke2fs | | | | 0sysfs |
| 1.39 (29-May-2006) | | | | sys sysfs |
| Filesystem label= | | | | defaults 0 |
| OS type: Linux | | | | 0proc |
| Block size=4096 (log=2) | | | | proc proc |
| Fragment size=4096 (log=2) | | | | defaults 0 0 |
| 2361760 inodes, 4721101 blocks | | | | /dev/cciss/c0d0p3 |
| 236055 blocks (5.00%) reserved for the super user | | | | swap swap |
| First data block=0 | | | | defaults 0 0 |
| Maximum filesystem blocks=4294967296 | | | | [root@lab1 ~]# mount -a |
| 145 block groups | | | | [root@lab1 ~]# swapon -a |
| 32768 blocks per group, 32768 fragments per group | | | | [root@lab1 ~]# swapon -s |
| 16288 inodes per group | | | | Filename |
| Superblock backups stored on blocks: | | | | Type Size Used Priority |
| 32768, 98304, 163840, 229376, 294912, | | | | /dev/cciss |
| 819200, 884736, 1605632, 2654208, | | | | c0d0p3 |
| 4096000 | | | | partition 8008392 0 -1 |
| | | | | |
| Writing inode tables: | | | | 35. Reboot and make sure everything comes up |
| done | | | | okay. |