Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I would like to move Ubuntu 11.10 from /dev/sda2 to /dev/sda1 (hd0,0) without loss of updates, data, etc., and update grub.

If Ubuntu is backed up, a new install to a clean ext4 partition on sda1, including a new grub install (normal), THEN, restore [Home] from backup.

Is that going to preserve all my Ubuntu updates? Must I backup the current install completely?

Thank you for any assistance in this matter.

share|improve this question

1 Answer 1

You can move the partition with a number of tools from dd to gparted. I would move it from a live CD.

Once you move the partition you need to do two things

update-grub

First mount your new root partition.

sudo mount /dev/sda1 /mnt

Prepare the chroot

for i in /dev /dev/pts /proc /sys; do sudo mount -B $i /mnt$i; done

I personally would update and re-install grub

sudo chroot /mnt
update-grub
grub-install /dev/sda

update fstab

While still in the chroot, edit /etc/fstab , make sure your root partition points to /dev/sda1

You can use "/dev/sda1" or UUID, to list your partitions by UUID use blkid

# If needed
blkid

nano /etc/fstab

Make sure your root entry looks something like

# / moved to /dev/sda1
UUID=xxxx-yyy-zzz  /  ext4  errors=remount-ro  0  1

Or

# / moved to /dev/sda1
/dev/sda1  /  ext4  errors=remount-ro  0  1

Reboot

Reboot your computer and all should be well.

All the assumes you do not have a separate /boot partition. If you do, when configuring the chroot, mount your boot partition at /mnt/boot

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.