Skip to content

How to move Arch installation from USB drive to hard drive

I am dual booting Windows 10 and Arch Linux. I am presently running Arch off of a USB drive, with GRUB set up to boot from the USB drive. I have Windows running on my hard drive, set up with the Windows boot manager to boot into Windows by default - that is to say, the Windows installation came first and then I set up Arch on my USB drive. I've decided I want to give Arch a permanent home on my hard drive, and ideally I'd like to be able to seamlessly move everything over to my hard drive. Can I shrink my Windows partition, use the space to create an ext4 partition, and then somehow move my Arch setup onto that partition? Any and all advice or questions are welcome. Thanks very much!

Solution by PavelPivovarov and nik_tavu worked perfectly. Thanks!

Edited 22 Sep 2021. We only hold this version.

27 points17 comments
Open on Reddit
About this post
Posted
Archived
Edited
Score
27 · 89% up
Kind
Text
ID
prn2vu

Author

3
posts
7
comments
0
media
View profile

17 comments

Migrating linux installation from one drive to another is pretty easy, here are the steps to take:

  1. Prepare and format the partition/partitions
  2. Copy everything using rsync in order to copy all existing file permissions and attributes
  3. Update /etc/fstab file so your mount points will be using new partition/partitions. Optionally if you are using or going to use encryption also update /etc/crypttab accordingly.
  4. Install bootloader (Grub, systemd-boot, rEFInd etc.) to the new drive, and update its configuration.
  5. Reboot.
20 points

rsync is a great tool. Using rsync -aAXH preserves everything (permissions, timestamps, links, etc) . Also you have to exclude the system directories ( /dev , /sys, /proc) and the directory of the destination if you copy from /.

So Let's say that the USB drive is mounted at /mnt.

Then the actual command is:

rsync -aAXH --exclude '/dev' --exclude '/sys' --exclude '/proc' --exclude '/mnt' / /mnt
12 points

Yes you can just copy the files with

cp -avx src dest

Be sure to mount all partitions beforehand and later don't forget to install GRUB separately

9 points
unknown author9 hidden

if you're gonna shrink your windows partition, do it in windows. i did it with cfdisk and learned the hard way

6 points

cfdisk shrinks partitions, but not filesystems. You can use gparted, parted, or other tools that can shrink the filesystem first.

9 points
unknown author1 hidden

the issue i'm talking about is windows failing to boot after shrinking the partition, would that be solved by shrinking the fs instead? sorry, i'm new

2 points

I am not sure about parted. gparted does shrink both, filesystems and partition. There are tools in ntfs*someting package that can shrink ntfs. It actually works better than doing it from windows - i was able to get more space and it moved the swap too. It is a miracle what you can achieve when windows is not running :-)

P.S.: There is also clonezilla on Arch ISO. I'd probably use that instead of rsync.

1 points

Use the windows partitioning tool to shrink your windows partition.

dd your existing installation to the new partition.

Set up efi.

4 points

definitely shrink the windows partition in windows, then I would use clonezilla and point it to the partition on the drive that you want to move to. It worked for me a while ago

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.