You are not logged in.

#1 2009-10-10 11:47:29

yms
Member
From: Switzerland
Registered: 2009-06-05
Posts: 64

Repartition disk and reimport the whole system

Hi everyone,

I have a working Arch Install and I love it. The only problem is that I need to repartition my HDD. The partition scheme is just slightly different. One partition that is now logical will be primary and most partitions (except one) will be slightly larger but that's it.
Meanwhile I need to reinstall Windows (I have a dual boot), then "copy/paste" my whole Arch system back and reinstall GRUB. For now I can think of a few problems.

1) If I reinstall GRUB from a live CD (would it work with Arch's install CD ?), will pacman still handle updates for it ?
2a) A friend advised me to use rsync to copy ALL of my system to an external HDD (I have JFS and ext2/3 partitions) and then use rsync again to recover my system (I was thinking of using a JFS external hard drive). Is it a good idea ? Will this keep all the needed metadata (privileges and such) ? Will it preserve symlinks ? hardlinks ?
2b) Is rsyncing really better than just copy-pasting all files ?
3) I guess I'll have to change my /etc/fstab once I have repartitioned, are there any other files to edit when I have my new partition scheme ?
4) How can I check that nothing has been broken/corrupted in the process ?

Are there "better"/alternative ways to do what I want (Repartition disk, reinstall Windows and get back my whole Arch system) ? What other problems could I encounter ?

Thank you in advance for your answers and sorry for my English (it is not my first language).


Sorry for any English mistakes, I am not a native speaker.

Offline

#2 2009-10-10 12:12:30

deej
Member
Registered: 2008-02-08
Posts: 395

Re: Repartition disk and reimport the whole system

Is there a problem in:

a> Repartition disk
b> Re-install 'doze [ *IF* the 'doze partition has been touched by the above step ]
c> Re-install Arch, from scratch ?

I presume there is an over-riding reason why the above will not do ?

Deej

Last edited by deej (2009-10-10 12:13:51)

Offline

#3 2009-10-10 12:20:00

yms
Member
From: Switzerland
Registered: 2009-06-05
Posts: 64

Re: Repartition disk and reimport the whole system

Hi,
I'll reinstall Windows anyway because my university gives away licenses for Windows 7 and I currently have Vista installed (I hope they fixed a few things in Windows 7).
The reason I don't want to reinstall Arch from scratch is that I've spent tens of hours configuring everything this summer and now that (almost) everything works, I want to keep my config files and such.


Sorry for any English mistakes, I am not a native speaker.

Offline

#4 2009-10-10 12:24:48

deej
Member
Registered: 2008-02-08
Posts: 395

Re: Repartition disk and reimport the whole system

You could simply burn your 'specially modified' configs to cd/dvd and use them
to replace the standard ones provided by a new install. On my system I have a
separate '/backup' partition [ wait for the screams "...a backup on the same hard
drive...!"; it's mine, I'll do what I like big_smile ], where I keep my configs. I have a script
I run on a new install to copy them over to the correct places, and the jobs done !


Deej

Offline

#5 2009-10-10 15:59:48

vacant
Member
From: downstairs
Registered: 2004-11-05
Posts: 816

Re: Repartition disk and reimport the whole system

Use rsync, use tar, use "cp -a" ... whatever you're happy with, they all work.

I had a great day yesterday reconfiguring my laptop:

1) defragged vista on sda1
2) used a kubuntu livecd gparted to shrink the vista partition to 33 GB
3) used an arch live CD to transfer my two arch, kubuntu, and other partitions over the network to another pc (netcat)
4) set up a 150MB sda2 ext2 /boot
5) set up an encrypted sda3 over the rest of the disk
6) set up LVM2 on the encrypted partition
7) loaded back all the distros and file stores using netcat onto the new logical volumes

Went like a dream. There's enough on the Arch boot image. So if you forget to edit an fstab ist isn't a show-stopper.

And I find transferring an entire Arch partition far less work than installing from scratch - though I'd take the opportunity to re-install if I had a distro I thought might be broken somewhere.

Offline

#6 2009-10-10 23:20:06

Gen2ly
Member
From: Sevierville, TN
Registered: 2009-03-06
Posts: 1,529
Website

Re: Repartition disk and reimport the whole system

For re-installing grub take a look up bootloader on the wiki.  Pretty sure you'll just need to update fstab to get all your disks set back up again.


Setting Up a Scripting Environment | Proud donor to wikipedia - link

Offline

#7 2009-10-17 23:19:33

thetrivialstuff
Member
Registered: 2006-05-10
Posts: 191

Re: Repartition disk and reimport the whole system

yms wrote:

1) If I reinstall GRUB from a live CD (would it work with Arch's install CD ?), will pacman still handle updates for it ?

Should be fine. Grub doesn't change that often, and I don't think I've ever needed to re-do grub-install because of an update.

yms wrote:

2a) A friend advised me to use rsync to copy ALL of my system to an external HDD (I have JFS and ext2/3 partitions) and then use rsync again to recover my system (I was thinking of using a JFS external hard drive). Is it a good idea ? Will this keep all the needed metadata (privileges and such) ? Will it preserve symlinks ? hardlinks ?

Yes, yes, and yes. However, so will cp -a. If you're just using an external drive attached to your local system to do this, cp -a should be fine.

yms wrote:

2b) Is rsyncing really better than just copy-pasting all files ?

If you're copying to a separate machine over a network, I prefer rsync. It's easier than net-mounting the target drive and then copying to it, and network filesystems have a way of sometimes mangling ownership & permissions, depending what your setup is. This doesn't apply in your case though.

One caution about just copy&pasting your filesystem (not sure if this still applies with current udev, actually) -- you can't boot with a totally empty /dev. Copying all of the device entries from a booted, mounted /dev/ into your backup and then copying them back works fine, but it's probably better to do this:

mount -o bind / /mnt/temp-root
cp -a /mnt/temp-root/dev /your-backup-root/dev
umount /mnt/temp-root

That'll give you the device entries that are actually in your root filesystem's /dev, before /dev gets mounted on top of it.

yms wrote:

3) I guess I'll have to change my /etc/fstab once I have repartitioned, are there any other files to edit when I have my new partition scheme ?

crypttab, if you have any encrypted partitions. /etc/suspend.conf if you're using userspace suspend (it'll need to know the new swap partition to resume from after s2disk). mdadm.conf if you have software RAID and are using that. Likewise for stuff in /etc/lvm (possibly).

yms wrote:

4) How can I check that nothing has been broken/corrupted in the process ?

On your current system:

find / -type f -print0 | xargs -0 md5sum >> /big-file-checksum-list

When you've got everything copied back:

find / -type f -print0 | xargs -0 md5sum >> /big-file-checksum-list2

Then sort those two files and compare them.

yms wrote:

Are there "better"/alternative ways to do what I want (Repartition disk, reinstall Windows and get back my whole Arch system) ? What other problems could I encounter ?

Some things I ran into while installing Windows 7:

- Win7 has a separate 100MB boot partition. As far as I know, it's not easy to pick an existing partition and tell it, "this is your boot partition." I just let the installer create it for me.

- Win7 does not obey some partition table conventions -- I can't edit my partition table with cfdisk because Windows 7 apparently got some disk geometry slightly wrong (You know that 8mb of free space that XP & NT used to leave at the end of disks? I don't think they've fixed that yet). fdisk, parted, and sfdisk are all OK though.

Edit: one of the Win7 problems turned out to be something else; removed it.

Last edited by thetrivialstuff (2009-11-04 19:34:27)

Offline

Board footer

Powered by FluxBB