LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   What is the best way to move /boot to /? (https://www.linuxquestions.org/questions/linux-newbie-8/what-is-the-best-way-to-move-boot-to-4175461457/)

DavidDiepUSC 05-10-2013 02:14 PM

What is the best way to move /boot to /?
 
Hi Linux gurus,

When I initially installed RHEL6, I had /boot on its own partition. Now I want to move it to another partition, which is occupied by /.

I want to have /boot under the / directory. What is the best way to do this... I want to avoid installing it all over again. That would be a shame.


Thanks!

business_kid 05-10-2013 03:15 PM

Figure out first how to reconfigure your boot loader, whatever that is. Then, maybe something like this as root?

Quote:

umount /boot
mkdir /mnt/tmp
mount <boot's partition> /mnt/tmp
cp -a /mnt/tmp/* /boot/ && sync

Then reconfigure your boot loader and /etc/fstab. The line for /boot is no longer needed, unless you're mounting it somewhere else.

John VV 05-10-2013 05:22 PM

just "moving" data in /boot partition to a folfer on /
will still leave you a /boot partition that you are not using and is taking up one of the primary partitions

Also if / is a LVM and NOT ext3
or
if /is ext4
you will NOT be able to move GRUB-legacy on RHEL6.4
The legacy grub needs ext2 or ext3
and on a primary partition

syg00 05-10-2013 07:29 PM

Quote:

Originally Posted by John VV (Post 4948769)
The legacy grub needs ext2 or ext3
and on a primary partition

Not true.
The issue with ext4 was that the increased inode size wasn't handled in legacy grub. However this also applied to any ext3 filesystem created post the roll-out of ext4 support in e2fsprogs. The major distros patched grub to accommodated this.
There has never been requirement for a primary partition - that only applies to Windows loaders, although some (old) BIOS also demand a boot flag be set on a primary partition. But that is a different issue again.

DavidDiepUSC 05-13-2013 08:55 AM

Thanks for the input everyone.

The / is not a LVM it is ext4, so is /boot.

So the question is, how to reconfigure the bootloader. I'm running my system off a IBM Z machine, I believe the bootloader is /etc/zipl.conf... it doesn't really make any reference to what partition the /boot is on, so think there wouldn't be any need for a modification:

Code:

[defaultboot]
timeout=5
default=linux-2.6.32-220.el6.s390x
target=/boot/
[linux-2.6.32-220.el6.s390x]
        image=/boot/vmlinuz-2.6.32-220.el6.s390x
        ramdisk=/boot/initramfs-2.6.32-220.el6.s390x.img
        parameters="root=/dev/disk/by-path/ccw-0.0.0101-part1 rd_NO_LUKS rd_DASD=0.0.0301 rd_DASD=0.0.0300 rd_NO_MD  KEYTABLE=us SYSFONT=latarcyrheb-sun16 crashkernel=auto rd_DASD=0.0.0103 rd_DASD=0.0.0101 rd_NO_LVM rd_NO_DM LANG=en_US.UTF-8"

I do see a need to modify the fstab:

Code:

#
# /etc/fstab
# Created by anaconda on Wed May  8 13:32:47 2013
#
# 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.0101-part1 /                      ext4    defaults        1 1
/dev/disk/by-path/ccw-0.0.0100-part1 /boot                  ext4    defaults        1 2



All times are GMT -5. The time now is 12:33 AM.