You are not logged in.

#1 2012-12-23 21:56:58

Leandros
Member
Registered: 2012-12-01
Posts: 25

Completely mirror Arch Linux installation from my Desktop to my Laptop

I'am going on a vacation and don't wanna miss my already fully optimized OS (which took my days to achieve).

Is it possible to mirror this to my laptop?

Last edited by Leandros (2012-12-23 22:04:53)

Offline

#2 2012-12-23 22:14:22

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,441
Website

Re: Completely mirror Arch Linux installation from my Desktop to my Laptop

There are various approaches depending on a number of factors.:

1) Are the harddrives the same size?  If so you could `dd` the entire disk onto the other and you'd be set aside from issue number 2.  If the laptop drive is larger than the desktop you can still do this, but you won't be able to use any of the larger drive space.  If the laptop drive is smaller, you cannot use `dd`.  In this case rync would do.

2) Do the two computers have identical hardware?  Probably not.  They may need different drivers for video, ethernet, and wireless to name a few.


All in all, though, once you know how you want it set up it should not take more than 15-20 minutes to get a new installation set up.  Copying over a few configs is easy enought (eg bashrc, xresources, vimrc).


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2012-12-23 22:25:46

Leandros
Member
Registered: 2012-12-01
Posts: 25

Re: Completely mirror Arch Linux installation from my Desktop to my Laptop

Trilby wrote:

All in all, though, once you know how you want it set up it should not take more than 15-20 minutes to get a new installation set up.  Copying over a few configs is easy enought (eg bashrc, xresources, vimrc).

Everything is modded, from my Awesome WM to themed terminal emulator, different bash, even my keyboard layout isn't a standard one (bone2).

Basically the only way to achieve this is to do a new installation (which is easy) and copy over everything?

I need a list of all my installed packages (how to get, it seems pacman can't do it natively and paclist is only for one repo), also I need every .xx file in my home directory. Am I missing something?

Offline

#4 2012-12-23 23:05:52

2ManyDogs
Forum Moderator
Registered: 2012-01-15
Posts: 4,645

Re: Completely mirror Arch Linux installation from my Desktop to my Laptop

Leandros wrote:

Basically the only way to achieve this is to do a new installation (which is easy) and copy over everything?

No, that's not what Trilby said. A new install is one way, but he also said you could use "dd" if the hard drives are the same size, and rsync if they are not, but you may have problems if the hardware is not identical. You may also have only minor problems that are easily solved by installing the appropriate driver or by editing a few files. This wiki topic has more information: https://wiki.archlinux.org/index.php/Mi … w_hardware

Last edited by 2ManyDogs (2012-12-23 23:10:41)


How to post. A sincere effort to use modest and proper language and grammar is a sign of respect toward the community.

Offline

#5 2012-12-23 23:11:53

Leandros
Member
Registered: 2012-12-01
Posts: 25

Re: Completely mirror Arch Linux installation from my Desktop to my Laptop

2ManyDogs wrote:

No, that's not what Trilby said. A new install is one way, but he also said you could use "dd" if the hard drives are the same size, and rsync if they are not, but you may have problems if the hardware is not identical. This wiki topic has more information: https://wiki.archlinux.org/index.php/Mi … w_hardware

Ok, my concern about the method with rsync is, will it be bootable? The hardware is different.

Offline

#6 2012-12-23 23:15:26

BluMongoose
Member
From: 'Murica
Registered: 2012-04-24
Posts: 49

Re: Completely mirror Arch Linux installation from my Desktop to my Laptop

In the pacman tips section of the wiki, there is a section on backing up and retrieving a list of user installed packages:  https://wiki.archlinux.org/index.php/Pa … d_packages.


"Think for yourself and question authority." -T. Leary

Offline

#7 2012-12-23 23:15:55

Onyros
Member
From: Lisbon, Portugal
Registered: 2007-10-11
Posts: 307

Re: Completely mirror Arch Linux installation from my Desktop to my Laptop

I did this very thing with two laptops. I dd'ed the installation I had on my Acer 1410 to a Thinkpad X200s, even though drive sizes were different, the Thinkpad's had more capacity - I just resized partitions with leftover space with gparted later on.

Almost everything worked out of the box, it even booted into X without any changes. I just had to change a few modules here and there, install some specific software for the Thinkpad's hardware and was good to go. I did it for science. tongue

I had wanted to try something like that for some time, to see how it would work out, and am typing this from that very installation - which, in theory is about to reach 3 years of age. I could just have done a fresh install, but the time I take configuring things to my liking, installing software - even with a few scripts I wrote to make it easier - would take much longer than what dd and subsequent cleanup took me.

Offline

#8 2012-12-23 23:26:32

Leandros
Member
Registered: 2012-12-01
Posts: 25

Re: Completely mirror Arch Linux installation from my Desktop to my Laptop

The HDD on my laptop is 232 GB and the on my desktop 298 GB, ok. I guess I'll try the dd method. Is there any useful to read outthere?

I can totally erase the hdd, no important data on there.

Last edited by Leandros (2012-12-23 23:30:32)

Offline

#9 2012-12-23 23:31:30

2ManyDogs
Forum Moderator
Registered: 2012-01-15
Posts: 4,645

Re: Completely mirror Arch Linux installation from my Desktop to my Laptop

Leandros wrote:

Is there any useful to read outthere?

2ManyDogs wrote:

This wiki topic has more information: https://wiki.archlinux.org/index.php/Mi … w_hardware

You can't use "dd" if your laptop drive is smaller than your desktop. No matter how you do this, there will be some work involved to get it all working. Read the wiki.

Last edited by 2ManyDogs (2012-12-23 23:34:19)


How to post. A sincere effort to use modest and proper language and grammar is a sign of respect toward the community.

Offline

#10 2012-12-23 23:33:05

Leandros
Member
Registered: 2012-12-01
Posts: 25

Re: Completely mirror Arch Linux installation from my Desktop to my Laptop

HeHe, thanks. Does it matter I don't use the whole HDD on my desktop?

  % lsblk                                                                                                        !2849
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 298.1G  0 disk 
├─sda1   8:1    0   100M  0 part 
├─sda2   8:2    0   120G  0 part 
├─sda3   8:3    0     1K  0 part 
├─sda5   8:5    0  93.1G  0 part 
├─sda6   8:6    0    80G  0 part /
└─sda7   8:7    0   4.9G  0 part 

Offline

#11 2012-12-24 03:10:22

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,130

Re: Completely mirror Arch Linux installation from my Desktop to my Laptop

You still can't use dd. It does a block level copy. rsync will do the job. Read the wiki.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#12 2012-12-24 07:40:47

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

Re: Completely mirror Arch Linux installation from my Desktop to my Laptop

Just "back it up" to a different drive, or over the network.

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


"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

#13 2012-12-24 16:12:15

Leandros
Member
Registered: 2012-12-01
Posts: 25

Re: Completely mirror Arch Linux installation from my Desktop to my Laptop

Ok, thanks a lot. I'll try it in the next days.

Offline

#14 2012-12-24 17:37:33

firecat53
Member
From: Lake Stevens, WA, USA
Registered: 2007-05-14
Posts: 1,542
Website

Re: Completely mirror Arch Linux installation from my Desktop to my Laptop

Another option -- could be a good backup too...use fsarchiver. I've done this before and it works great, especially with modules typically being autoloaded.

1. Install and use fsarchiver to save your filesystems (using either savefs or savedir) to an external hard drive or flash drive. You should probably do this while booted from a live CD (like system rescue)
2. Boot the laptop with the system rescue CD and partition your drive. Nice thing about fsarchiver is the partition size doesn't have to match exactly! Use fsarchiver restorefs or restoredir to copy your system to the new machine
3. Chroot into your new installation and 'mkinincpio -p linux'. Make sure any specific drivers (aka wireless and video) are installed
4. Install the bootloader

Done smile (hopefully I got all the steps)

Scott

Edit: See here for some possible glitches when using 'savefs' as opposed to 'savedir'.

Last edited by firecat53 (2012-12-24 17:44:22)

Offline

#15 2012-12-27 17:29:22

Leandros
Member
Registered: 2012-12-01
Posts: 25

Re: Completely mirror Arch Linux installation from my Desktop to my Laptop

I made a backup with rsync now. I realized I saved everything on a NTFS partition.

Should I redo it on a ext3 or ext4 partition?

This is the output of the rsync script:

rsync: set_acl: sys_acl_set_file(var/log/journal/3f66fdf67ade46e78452456adf947188/.user-1000.journal.jLFu9w, ACL_TYPE_ACCESS): Operation not supported (95)

sent 54396460132 bytes  received 12713489 bytes  7150164.09 bytes/sec
total size is 54342332478  speedup is 1.00
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1052) [sender=3.0.9]
total time: 126 minutes, 49 seconds

Offline

#16 2012-12-27 18:57:35

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,130

Re: Completely mirror Arch Linux installation from my Desktop to my Laptop

Yes. You should redo it using ext4 or ext3 on the target (assuming this is what you're using on the source). Otherwise you will lose information which can't be captured on NTFS and that will cause problems on the laptop.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#17 2012-12-27 20:48:30

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

Re: Completely mirror Arch Linux installation from my Desktop to my Laptop

NTFS has no concept of file permissions or ownerships.

Use EXT4.


"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

#18 2012-12-27 22:22:33

Leandros
Member
Registered: 2012-12-01
Posts: 25

Re: Completely mirror Arch Linux installation from my Desktop to my Laptop

DSpider wrote:

NTFS has no concept of file permissions or ownerships.

Yes, I know. I noticed it after the sync was complete.

Ext4 sync is complete, too:

sent 54731623343 bytes  received 12730284 bytes  15953476.21 bytes/sec
total size is 54676789214  speedup is 1.00
total time: 57 minutes, 12 seconds

How fast compared to ntfs (backup was written on an old USB 2 HDD, a WD4000AAKS). wink


Now just copy the backup over to my laptop?

Last edited by Leandros (2012-12-27 22:25:20)

Offline

#19 2012-12-27 22:54:57

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,130

Re: Completely mirror Arch Linux installation from my Desktop to my Laptop

Pretty much. Partition etc. first and then rsync to the laptop. Then make the changes you need to make to work on the laptop. At least, that's what I would probably do.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#20 2012-12-27 22:56:35

Leandros
Member
Registered: 2012-12-01
Posts: 25

Re: Completely mirror Arch Linux installation from my Desktop to my Laptop

cfr wrote:

Pretty much. Partition etc. first and then rsync to the laptop. Then make the changes you need to make to work on the laptop. At least, that's what I would probably do.

I partitioned it. But I wanted to just copy it over with cp. Should I do it with rsync? If yes, how?

Last edited by Leandros (2012-12-27 22:57:32)

Offline

#21 2012-12-27 23:00:55

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,130

Re: Completely mirror Arch Linux installation from my Desktop to my Laptop

Partition; create filesystems on partitions; rsync.

You just use the same command for rsync you used to backup. rsync -aAXv is a better option than cp (even with the -a option) because you need the file attributes to be transferred - not just the files themselves. It is no different than the backup operation except for the targets. rsync from desktop (or backup) to laptop just as you rsynced from desktop to backup. The wiki has details, as does the man page.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#22 2012-12-28 03:12:35

Leandros
Member
Registered: 2012-12-01
Posts: 25

Re: Completely mirror Arch Linux installation from my Desktop to my Laptop

I recreated the grub.cfg on my laptop with grub-mkconfig -o /boot/grub/grub.cfg on a arch live cd. But grub won't boot into the new partition. It wants to boot into my old partition and I land in the grub rescue console.

set prefix=(hd1,1)/boot/grub
set root=(hd1,1)
insmod linux
insmod normal

don't work. I get a error that the insmod files are not found.

Offline

#23 2012-12-28 04:14:33

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,130

Re: Completely mirror Arch Linux installation from my Desktop to my Laptop

Did you install grub to disk?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#24 2012-12-28 09:43:44

Leandros
Member
Registered: 2012-12-01
Posts: 25

Re: Completely mirror Arch Linux installation from my Desktop to my Laptop

Good point, maybe I should install grub again. ^_^

I thought I could just use the old grub, which is installed in my backup and only update the cfg (which I did, grub.cfg know the new OSs).

Offline

#25 2012-12-28 12:48:51

Leandros
Member
Registered: 2012-12-01
Posts: 25

Re: Completely mirror Arch Linux installation from my Desktop to my Laptop

I can't install Grub again, I get an Error that Grub is not readable on boot.
If I try to boot, grub tell me: no such device: f7xxxxxxxxxxxxxxxxxxxx

If I enter set in grub rescue I get the old partitions from my desktop, although I changed the grub.cfg. Do I have to change the menu.lst?

Offline

Board footer

Powered by FluxBB