You are not logged in.

#1 2012-10-07 16:48:57

dunric29a
Member
Registered: 2005-12-16
Posts: 23

Move ArchLinux installation to other partition

Hello,

  as I finally fine-tuned and repeatedely tested Windows installation in Virtualbox to my complete satisfaction I have no use for the stock Win7 installation on the 1st partition more.
  I know I can format it to ext4 and mount as additional partition or use LVM but I would like to copy/move my current ArchLinux system to this 1st partition and then extend it to use the whole disk as a single ext4 partition + one swap partition. I'm asking if it's enough to copy whole contents with

cp -r --preserve-all /mnt/oldpartition/ /mnt/newpartition 

to do "verbatim" copy/clone or am I missing something here ? The previous code should copy all file attributes and capabilities. The original install is on Ext4 partition. As the last step is to update etc/fstab  and grub config of course.

Offline

#2 2012-10-07 17:42:16

Lennie
Member
From: Sweden
Registered: 2011-10-12
Posts: 146

Re: Move ArchLinux installation to other partition

Even simpler, you don't even need a live-cd for this. It's in the wiki.

https://wiki.archlinux.org/index.php/Fu … with_rsync

Offline

#3 2012-10-07 17:44:45

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,728

Re: Move ArchLinux installation to other partition

That might work.  It does avoid the pitfalls of recursively moving down the /mnt directory.  I am not sure what happens to links -- be they hard or soft.

You might check out this article: https://wiki.archlinux.org/index.php/Fu … with_rsync


Edit: Rats, snaked again !  smile

Last edited by ewaller (2012-10-07 17:45:30)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#4 2012-10-07 18:28:13

dunric29a
Member
Registered: 2005-12-16
Posts: 23

Re: Move ArchLinux installation to other partition

Nice idea to use rsync, thanks. Anybody with a personal experience ? Are there some pitfalls or is such method on par with cp concerning reliability and completeness ?

Offline

#5 2012-10-07 19:44:25

DSpider
Member
From: Romania
Registered: 2009-08-23
Posts: 2,273

Re: Move ArchLinux installation to other partition

If you plan on moving it, you may need to reinstall the bootloader, which is very easy: chroot and reinstall like it says in the Beginners' Guide. Use an Arch "live" medium to be able to run the "arch-chroot" script instead of typing all of that.

Last edited by DSpider (2012-10-07 19:46:52)


"How to Succeed with Linux"

I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).

Offline

#6 2012-10-07 20:21:11

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Move ArchLinux installation to other partition

I have used rsync and tar to move a filesystem.  I wanted to change filesystems, and it worked no problem.  That is be beauty of everything being a file.

I think I may end up doing this again soon, as I read reports that jfs will support trim in an upcoming kernel release.

Offline

#7 2012-10-08 01:21:34

hunterthomson
Member
Registered: 2008-06-22
Posts: 794
Website

Re: Move ArchLinux installation to other partition

You would be better off useing 'cp' with the '--archive'  flag. That will make sure everything is correct i.e. symlinks, bla, bla. When doing things like this I always do them one directory at a time i.e. /root /bin /sbin . . . to avoid any problems.

If the current Arch partition and the Windows partition are back-to-back then you could just delete the Win part and expand the Arch part. Then expand the ext4 filesystem.

Last edited by hunterthomson (2012-10-08 01:25:07)


OpenBSD-current Thinkpad X230, i7-3520M, 16GB CL9 Kingston, Samsung 830 256GB
Contributor: linux-grsec

Offline

#8 2012-10-08 02:32:22

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Move ArchLinux installation to other partition

I don't understand why cp would be better than rsync or tar, since they all have options to preserve permissions, acls, etc.

Offline

#9 2012-10-08 07:48:21

DSpider
Member
From: Romania
Registered: 2009-08-23
Posts: 2,273

Re: Move ArchLinux installation to other partition

If the reason for the move is because of a space issue, you should look into LVM. With that you can adjust the partition size on-the-fly.


"How to Succeed with Linux"

I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).

Offline

#10 2012-10-08 17:15:06

Roken
Member
From: South Wales, UK
Registered: 2012-01-16
Posts: 1,251

Re: Move ArchLinux installation to other partition

I've migrated my system to different drives on two occasions, the first time using cp and the second time using rsync.

I learned that cp doesn't necessarilly preserve ALL attributes (case in point was that "ping" stopped working unless I was root, because the SUID got messed up), whereas rsync preserved everything. I also quite like the --exclude option of rsync, allowing for a selective migration in a single command whilst not copying stuff you don't need to.


Ryzen 5900X 12 core/24 thread - RTX 3090 FE 24 Gb, Asus Prime B450 Plus, 32Gb Corsair DDR4, Cooler Master N300 chassis, 5 HD (1 NvME PCI, 4SSD) + 1 x optical.
Linux user #545703

Offline

#11 2012-10-10 11:32:33

dunric29a
Member
Registered: 2005-12-16
Posts: 23

Re: Move ArchLinux installation to other partition

Roken wrote:

I've migrated my system to different drives on two occasions, the first time using cp and the second time using rsync.

I learned that cp doesn't necessarilly preserve ALL attributes (case in point was that "ping" stopped working unless I was root, because the SUID got messed up), whereas rsync preserved everything. I also quite like the --exclude option of rsync, allowing for a selective migration in a single command whilst not copying stuff you don't need to.

That's why you have to pass --preserve-all option. In your case file capabilities (see man 7 capabilities) were not preserved.

Offline

#12 2012-10-10 11:51:09

DSpider
Member
From: Romania
Registered: 2009-08-23
Posts: 2,273

Re: Move ArchLinux installation to other partition

man cp wrote:

-a, --archive
              same as -dR --preserve=all


"How to Succeed with Linux"

I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).

Offline

Board footer

Powered by FluxBB