I have finished moving my standard Fedora 14 install to a larger partition. I had a few bugs that others might encounter so I hope this tutorial will get them over the humps. This might work fine for any linux system if you want to move it to new drive or larger partition.
I tried Fedora from a live USB installer on a small partition of my old Windows XP desktop. Fedora was so nice that I decided to scrap M$ and give the whole partition to Fedora. The steps below are not the order I did them, because there were some crashes. I think following them in the order below could avoid the crashes with minimal troubles.
As always, BACKUP EVERYTHING FIRST!
And READ EVERYTHING BEFORE DOING ANYTHING!
And I recommend making a live USB in case there is a problem.
http://fedoraproject.org/wiki/FedoraLiveCD/USBHowTo
Here you go!
Original Setup:
Code:
/dev/sda1 Windows XP about 60GB
/dev/sda2 Fedora 13 from live USB, updated to 14 over time, about 15GB
/dev/sda3 Linux Swap, 1GB
some free space left over
Goal, move fedora to sda1 and boot as if nothing changed.
Steps:
1) Open Disk Utility and scrap the Windows Partition
2) Reformat with EXT4, same as the current sda2
3) Open the terminal and become root with the little minus sign.
Code:
[user@Fedora ~]$ su -
4) Mount larger partion.
Code:
[root@Fedora ~]# mount /dev/hda1 /media/Fedora
5) Copy almost everything from smaller to larger partition
Code:
[root@Fedora ~]# rsync / /media/Fedora --exclude=/proc --exclude=/media -avi
6) Edit /etc/fstab on the larger partition to use the correct UUID for the boot volume. It is the first line in this example which has the / after the UUID.
Code:
[root@Fedora ~]# gedit /media/Fedora/etc/fstab
#
# /etc/fstab
# Created by anaconda on Sat Jul 10 20:25:08 2010
#
# 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
#
UUID=51b65793-daf4-40b8-a15a-7f15f5f638e1 / ext4 defaults 1 1
UUID=d5e417c7-f5d6-4735-8932-6329699b6d4c swap swap defaults 0 0
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
[
NOTE: How to know the UUID of the new partition?
Code:
[root@Fedora ~]# blkid
/dev/sda1: LABEL="Fedora" UUID="51b65793-daf4-40b8-a15a-7f15f5f638e1" TYPE="ext4"
/dev/sda2: LABEL="Fedora-13-i686-L" UUID="305f4bb4-926f-4900-b096-a946d200862c" TYPE="ext4"
/dev/sda3: UUID="d5e417c7-f5d6-4735-8932-6329699b6d4c" TYPE="swap"
7) Edit /media/Fedora/boot/grub/grub.conf to change root entries to the proper partition and to aim the boot command to the proper UUID. In my case it was changing from (hd0,1) to (hd0,0), and the UUID like in the previous change.
Mine originally had a Windows XP on the larger partition, so I removed that entry at the bottom and added a fallback to get to my original system in case something failed. (Something failed, so I was thankful for that.)
There were other entries, but I just show the top one and my fallback. Notice the UUID= on the new partition.
Code:
[root@Fedora ~]# gedit /media/Fedora/boot/grub/grub.conf
default=1
timeout=5
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
hiddenmenu
title Fedora (2.6.35.11-83.fc14.i686.debug)
root (hd0,0)
kernel /boot/vmlinuz-2.6.35.11-83.fc14.i686.debug ro root=UUID=51b65793-daf4-40b8-a15a-7f15f5f638e1 rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us rhgb quiet
initrd /boot/initramfs-2.6.35.11-83.fc14.i686.debug.img
title Fedora (2.6.35.11-83.fc14.i686)
root (hd0,0)
kernel /boot/vmlinuz-2.6.35.11-83.fc14.i686 ro root=UUID=51b65793-daf4-40b8-a15a-7f15f5f638e1 rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us rhgb quiet
initrd /boot/initramfs-2.6.35.11-83.fc14.i686.img
#Fallback Entry
title Fedora on 0,1 (2.6.35.11-83.fc14.i686)
root (hd0,1)
kernel /boot/vmlinuz-2.6.35.11-83.fc14.i686 ro root=UUID=305f4bb4-926f-4900-b096-a946d200862c rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us rhgb quiet
initrd /boot/initramfs-2.6.35.11-83.fc14.i686.img
8) Put grub on the larger partition as the default
Code:
[root@Fedora ~]# grub
grub> device (hd0) /dev/sda
grub> root (hd0,0)
grub> setup (hd0)
grub> quit
[root@Fedora ~]#
Optional step: Reboot with the recovery drive and rsync again. If you do this add some excludes so that you don't over write the files that were just edited.
Also leave out the front slash of the excludes.
Code:
[root@Fedora ~]# mount /dev/sda1 /media/Fedora
[root@Fedora ~]# mount /dev/sda2 /media/Fedora-13
[root@Fedora ~]# rsync /media/Fedora-13 /media/Fedora --exclude=proc --exclude=media --exclude=boot/grub/grub.conf --exclude=etc/fstab -avi
Remove recovery drive and reboot again.
If all goes well, it is supposed to become the same system, but on the larger partition.
ACK! I Cannot login. The graphical login starts but keeps crashing. I only see a little spinner, and then a blinking line on the top left.
If I do Ctrl + Alt + Delete, the system reboots normally.
I had configured auto login on this system. (If you have not configured auto login, you might be at the login screen but unable to login by any user name.)
You think it is a problem, but it is selinux doing it's job.
I found this error message in the /var/log/messages of the larger partition after using my fall-back boot selection.
Code:
SELinux is preventing /usr/libexec/gdm-session-worker "entrypoint" access on /etc/X11/xinit/Xsession.
So how to fix? I found the answer the fedora bug hunter page.
You have to rebuild the indexes and labels of the system. So, at the grub boot menu, select the option that lets you edit the kernel parameters. Add either a '1' or 'single' to the end of the kernel parameters, then continue booting up.
So I rebooted, hit some key to interrupt and chose:
Quote:
e - edit commands before booting
|
Then select the second line and add single at the end
Quote:
root (hd0,0)
kernel /boot/vmlinuz-2.6.35.11-83.fc14.i686 ro root=UUID=51b65793-daf4-40b8-a15a-7f15f5f638e1 rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us rhgb quiet single
initrd /boot/initramfs-2.6.35.11-83.fc14.i686.img
|
It boots right to the root user. So I put the selinux rebuild index command:
Code:
root@fedora ~]# touch /.autorelabel; reboot
It took about 30 minutes to rebuild, but now it is all there on the larger partition.
I hope it works for you.