Results 1 to 7 of 7

Thread: how to move filesystem to new partition

  1. #1
    Join Date
    Jan 2008
    Location
    Australia
    Beans
    268
    Distro
    Ubuntu 11.04 Natty Narwhal

    how to move filesystem to new partition

    Hi all,

    My Ubuntu 8.04 root filesystem (Originally Ubuntu, added KDE later) is on an 11GB partition which in hindsight, should have been bigger.

    I recently got rid of Windows XP all together so now have a spare 40GB partition (on a different hard drive) which I would like to move the entire root filesystem to.

    Wondering if this is possible to be done safely and also if there are any step-by-step instructions available that I could follow? (in determining if I could follow them think of me as a Linux newb but fairly good at understanding concepts. e.g. I can use the command line without hassle but don't know too many commands yet!)

    Thanks guys
    Aaron

  2. #2
    Join Date
    Dec 2005
    Beans
    19,305
    Distro
    Ubuntu 13.10 Saucy Salamander

    Re: how to move filesystem to new partition

    I would use Clonezilla to move it.
    Learning is not attained by chance, it must be sought for with ardor and attended to with diligence. Abigail Adams ( 1744 - 1818 ), 1780;

    My blog Poetry and More Free Ubuntu Magazine

  3. #3
    Join Date
    Jan 2008
    Location
    Australia
    Beans
    268
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: how to move filesystem to new partition

    bump

  4. #4
    Join Date
    Oct 2006
    Location
    Belgrade, Serbia
    Beans
    1,325
    Distro
    Ubuntu

    Re: how to move filesystem to new partition

    dont have time for a step-by-step instruction, nor is it 110% safe, but it worked for me! I resized 5-6 ext3 partitions using gparted

    The best way to use is either by booting up from a ubuntu livecd and head to system > administration > partition editor
    *or*
    you could use the live gparted that contains gnome and gparted:
    http://downloads.sourceforge.net/gpa...7&big_mirror=0
    http://gparted.sourceforge.net/download.php

  5. #5
    Join Date
    Mar 2007
    Location
    Here & Now
    Beans
    16,549
    Distro
    Ubuntu 11.04 Natty Narwhal

  6. #6
    Join Date
    Aug 2006
    Location
    Madrid, Spain
    Beans
    299
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: how to move filesystem to new partition

    Your best chance is possibly booting from a Live CD, mounting both the source and the destination volumes and performing the copy with tar like this:
    This example assumes that
    • your source is /dev/sda1
    • your dest is /dev/sdb5, still unformatted and you want to use ext3
    • you are using an Ubuntu Live CD:

    Code:
    ubuntu@ubuntu:/$ sudo -s
    /# mkdir /mnt/src /mnt/dest
    /# mount -r /dev/sda1 /mnt/src
    /# mkfs.ext3 /dev/sdb5
    /# mount /dev/sdb5 /mnt/dest
    /# cd /mnt/src
    /mnt/src# tar -cp . | tar -xpv -C /mnt/dest
    As you might guess, the copy might take long. The -p flag to tar will preserve permissions, preventing havoc when rebooting. Take note that the last C (in -xpv -C) is a capital C meaning "change directory", as opposed to the fist (in -cp) meaning "create archive". After the copy finishes, you will need to check and possibly correct the following files and programs:
    • /etc/fstab, which contains the table of filesystems to be mounted. Your root partition is identified by its UUID. Run "vol_id -u" on the target device and paste the new uuid.
    • /boot/grub/menu.lst (for GRUB 0.9x) or /boot/grub/grub.cfg (for GRUB 1.9x). Either of these files contain the bootloader config. If you are going to remove the HD with the old root partition completely you might need to reinstall GRUB (grub-install /dev/sdb in this case), but even if you're not, you need to find all the instances of the old root UUID and switch it for the new one

    If you are going to remove the old HD, make sure your /boot partition (if you kept it separate from the root) is copied too, then reinstall GRUB as specified above. Keep the Live CD handy for any possible problems, and good luck!

  7. #7
    Join Date
    Jun 2005
    Beans
    1,056
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: how to move filesystem to new partition


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •