Skip to content

dd whole arch install?

Hi there, I am using Arch Linux for a couple of months (basically since Dota2 got its Beta Client on Linux), and I still lack some basic knowledge sometimes :)

I got 2 SSDs in my computer, a 128GB (sdb) and a newer 512GB (sda). Arch happens to be installed on the smaller one. Now i would like to move the whole install over to the 512GB SSD (its a bit faster too).

Am I right in thinking that i need to:

  • Boot a live usb stick
  • dd if=/dev/sdb of=/dev/sda
  • resize the partitions afterwards
  • update my syslinux bootloader to deflect the change from sdb to sda?

Is that all? Am i missing something?

EDIT: See below how i did it actually :)

Edited 7 Dec 2013. We only hold this version.

30 points26 comments
Open on Reddit
About this post
Posted
Archived
Edited
Score
30 · 100% up
Kind
Text
ID
1sbfvu

Author

1
posts
19
comments
0
media
View profile

26 comments

That would work, but it would also waste a lot of time copying empty blocks to the new SSD. You're better off creating the partitions on the new disk and copying the files over.

16 points

Wow thanks I forgot about that. Would even stress the flash cells. A simple copy will do the trick? I am planning to remove the older 128GB SSD from the PC, so what about the MBR?

7 points

It might not stress the cells if the disk has enough logic to ignore writes of zeroed blocks. I suspect that they will. However, the driver will do what it's told and still send the command and data, wasting the amount of time it takes for the data to be sent and the drive to tell the OS that it's completed. That's probably small for individual blocks, but over the course of 128GiB it could add up.

As for the MBR, the people that have suggested chrooting are spot on. After copying the files, just treat it like a step in the installation process since you're using a liveusb.

3 points

why not rsync? You could rsync your whole /* or you could just set up a new install and rsync over important stuff.

13 points

no idea what rsync is, will give it a read now :)

2 points

Definitely do that. Simply create new partitions and file systems, use rsync to copy files over (there's probably many howtos online, but you should still read the rsync manpage). Then adjust the file system UUIDs in fstab and syslinux.cfg and reinstall syslinux.

This method will be better for your SSD than using dd.

Another post suggests using cp - that works when using the correct options, but rsync is better suited for this task.

8 points

Here is what i did:

  • Created a new partition table and partitions on the other SSD.
  • copyied using cp the whole partition contents
  • changed syslinux.cfg to reflect the changes
  • changed fstab to reflect the changes
  • On reboot i selected the new SSD to boot from.
  • resize2fs /dev/sda1

Everything is fine now, thank you very much everyone

Now i can go over to the next task, change the file system from ext4 to btrfs :)

7 points

You could have formatted your new partitions as btrfs and it would have worked. Also the resize2fs was unnecessary because the copy was filesystem-agnostic.

4 points

This is what i did afterwards today. Came out i wasnt quite happy with that so I also splited / and /home on 2 btrfs volumes.

1 points

dd is data wasteful for this, you'll have to resize anyway and may be time wasteful if there is an error.

Use a tar pipe instead and unlike cp -p, will preserve permissions AND recreate special files.

  1. Create partition and filesystem on new drive (GParted recommended unless you know what you're doing. Don't use sfdisk it has a bug affecting boot)
  2. Mount old partition to ex: /oldmnt
  3. Mount new partition to ex: /newmnt
  4. tar -C /oldmnt -cvpf - . | tar -C /newmnt -xvf -

(note: the v on both sides is for verbose output and will slow down the transfer significantly but nice to see progress)

6 points

You can rsync the whole os excluding folders such as /mnt and /media. I use rsync to backup the entire Arch install on an external drive.

3 points

I just wanted to say that I have in fact done this before when I got my ssd and I was moving from my larger hard disk to my smaller one. What I did is I moved all my larger data off onto another partition, shrunk the partition to the same size as my ssd, did a dd image of my now proper-sized partition, and then dd'd it to my ssd.

1 points
unknown author

I have to do it soon, too. But I planned using CloneZilla. It looks better.

0 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.