Find the answer to your Linux question:
Results 1 to 6 of 6
I want to move a working distro contents to a new partition, leaving behind the ReiserFS, and moving onto a fresh ext3 system. Can that be done reasonably simply without ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2006
    Location
    UK
    Posts
    33

    Question Filesystems - The Nuke Option?


    I want to move a working distro contents to a new partition, leaving behind the ReiserFS, and moving onto a fresh ext3 system. Can that be done reasonably simply without re-installing the distro?

    If I were to format a partition, and then copy the whole distro into it .. e.g.
    Code:
    ~#  mkfs.ext3 /dev/sda12
    ~# cp -v --preserve=all /dev/sda5 /dev/sda12
    Then afterward, get at the /boot/grub/menu.lst belonging to the default boot-up distro, and alter the partition number in the menu script to point to the new place the distro files have been put.

    Yes - I know. Words like "naive" and "simplistic" I can already feel coming, but I have to start somewhere. I already fear questions like "what happens with symbolic links"? Oops - there's that /etc/fstab that needs to know the new filesystem type!

    Reiser has done quite fine for a long time, but I am now persuaded another filesystem is the wiser choice. Is there a preferred way to do this?
    Last edited by Gtrax; 06-16-2008 at 08:12 PM. Reason: Remembered fstab

  2. #2
    Linux Guru Jonathan183's Avatar
    Join Date
    Oct 2007
    Posts
    3,042
    Have a look at this thread ... its a move to lvm but it should give you a good idea of issues

  3. #3
    Linux Guru bigtomrodney's Avatar
    Join Date
    Nov 2004
    Location
    Ireland
    Posts
    6,127
    I'd think if you were going to do it you'd might be better to backup your data, format your root partition and go back to that. You'll need to fix up fstab, amend grub's menu.lst as you mentioned and perhaps amend your initrd. I can imagine links breaking (as again you mentioned) and other strange problems.

    It'll certainly make for an interesting experience. I'll be reading up on your progress. If you wanted the easy route you could always reinstall. Less chance of breakage and it might be the end result anyway. Good luck!

  4. #4
    Just Joined!
    Join Date
    Nov 2006
    Location
    UK
    Posts
    33
    Not that I am at all like Moe, but I have been distro delving. No doubt most will get reworked eventually, but some were built for purpose, and I don't want to start from scratch right now.

    I have a mix of drives and partition types. The 2 big drives are LVMs, and do not carry distros. The main SATA has 14 partitions with sda1 being a little /boot now abandoned, sda2 is a 1G swap, sda3 is the extended, sda4 is not allowed, so the remainder sda5 onward carry distros.

    I confess to a prized fully working Gentoo
    A trashed adventure with Mepis 7.0
    The preserved /home from Mepis
    The present default PCLinuxOS
    A fast industrial Debian Etch with Xfce4
    A Debian Lenny with a Gnome desktop I have not set up right.
    A trashed Zenwalk - partition now given to XP in VirtualBox
    A new Ubuntu 8.04 with a Gnome desktop I have not set up right
    A whole SuSE 10.3 set up for industrial control automation
    A Studio64 aventure.

    OK - step 1. the trashed Mepis 7.0 provides the 20G space to to do this.
    I simply formatted it using..
    Code:
    ~# mkfs.ext3 /dev/sda6
    ~# tune2fs -c 65 -i 180d
    Remembering to fix the fstab ..
    Code:
     ~#kdesu kwrite /etc/fstab
    Fix the partition type mentioned to be ext3.
    Now comes - the risky copy command ..
    Code:
    ~# mount /dev/sda6 /mnt/sda6
    ~#cp -dPRp /mnt/sda5 /mnt/sda6
    Not a disaster, but my first mistake! I now have the prized Gentoo copied into a folder called "sda5" within /mnt/sda6.
    BUT .. it seems to have worked - so far. The next step is to trash the ReiserFS Gentoo partition, and make it ext3.
    Code:
    ~# mkfs.ext3 /dev/sda5
    Thats it !! My Gentoo is now in dire danger. You will understand that right now, I am going to fix me a little liquid comforter. Watch this space

  5. #5
    Linux Guru
    Join Date
    Nov 2007
    Location
    Córdoba (Spain)
    Posts
    1,513
    Quote Originally Posted by Gtrax View Post
    I want to move a working distro contents to a new partition, leaving behind the ReiserFS, and moving onto a fresh ext3 system. Can that be done reasonably simply without re-installing the distro?
    Yes. But you need to be aware of some things.

    First, make sure your kernel has support for the new file system. You shouldn't need to change your initrd, unless you are loading the filesystem modules from there, and ext3 has not been included. Then, revise fstab and grub.conf/menu.lst.

    As for the copy, there's no problem in that, as long as you are careful enough to preserve the ownerships and permissions while doing it. (tar -p or cp -a, there are other solutions, like rsync). I suggest copy, and not move, since that way you can still boot your old partition if needed. Remember also that you can edit the kernel lines in grub if something goes bad on the boot stage.

    So far, you seem to know all of this, so you shouldn't need anything more. There's no mystery on this operation and if you do it carefully and understand everything you shouldn't have any problem. I have done it many times with gentoo and some others.

    The most critical part is where you copy all the files, because if you screw up the permissions then you are, in fact, screwed. The rest means no problem, because if something goes bad, you can still boot your old partition, and in the worse case, you can boot a livecd, chroot and fix your kernel, fstab or whatever is failing.

  6. #6
    Just Joined!
    Join Date
    Nov 2006
    Location
    UK
    Posts
    33
    Its done - and my Gentoo survived!
    Down with 'convertfs' !

    The safest and really quite easy option is to copy it all to a safe place, then copy it all back onto same partition, having reformatted to the new filesystem. There follows a little phase just getting at the /etc/fstab to alter the lines mentioning the filesystem type.

    This only works if you take care to preserve the file attributes. File permissions, link destinations, everything. Fortunately, the copy command is easy. It only takes as long as needed to copy all away, and then copy back. Searching out the ways good and bad is easy too. Lots of folk have done this. i92guboj mentions all the right things, though you have to be a real minimalist to have a kernel that did not include ext3 just because you happen to be using reiserfs!

    This being coffee lounge, the detail can be discussed in other places, but I will warn against 'convertfs' It's for experts with patience! I experimented with converting my copied Debian Lenny. Before I went too far, I thought better of it. Its complicated, uses several stages, including a re-mapping that can take many days and MUST NOT be interrupted. The off-putting procedure is HERE
    Last edited by Gtrax; 06-21-2008 at 11:16 AM. Reason: ack i92guboj

Posting Permissions

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