moving a working partition over to a new device.

Forum rules
We don't support installations in VirtualBox, VMWare, qemu or others. We ignore posts about WINE, PlayOnLinux, Steam and Skype. We don't support btrfs, lvm, UEFI, side-by-side installations with GPT or dualboot with anything newer than Windows XP.
Google your problem first. Check the Wiki. Read the existing threads. It's okay to "hijack" an existing thread, yes! If your problem is not yet covered, open a new thread. To get the quickest possible help, mention the exact release codename in your post (uname -a is a good idea, too). Due to the lack of crystal balls, attach the output of lspci -nnk if you encounter hardware problems.
User avatar
wuxmedia
Grasshopper
Posts: 6454
Joined: Wed Oct 17, 2012 11:32 am
Location: Back in Blighty
Contact:

moving a working partition over to a new device.

Unread post by wuxmedia » Tue May 05, 2015 7:55 am

Finally got a new mSata card for the work machine, now it's a hassle to reinstall everything again, I just want to pull a cleaned up copy of the current partition over the new device, what would you recommend ?

HDD would probably stay around as back up or storage or something.

questions:
* dd it over at the block level?
* would it be best to boot from a USB then dd it all 'offline/unmounted' so to speak ?
that should take grub over also?
* change the boot order in the BIOS, then that should be it, no?

SSD/mSATA swappiness?
plenty of RAM anyway, turned swap to 0
"Seek, and Ye shall find"
"Github | Chooons | Site"

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: moving a working partition over to a new device.

Unread post by machinebacon » Tue May 05, 2015 10:12 am

Well, firstly you need to format the fucker, I did it manually with fdisk.

fdisk -c -u /dev/sdX
press o
let the new table be printed, so press 'p'
then create a new partition table, press 'n'
primary, press 'p'
choose '1' or enter
first sector at 2048, press enter (all starting sectors have to be dividable by 2048)
give it a size, like '+20G'
remember to 'p' print the table again
press 'w' to write it to the disk
then 'q' quit and check the alignment
parted /dev/sdX align-check opt


As for copying, I'd do it in a Live session, mount both drives and then copy over, probably the GUID have to be set too. And I think grub won't work without grub-install /dev/sdX and update-grub (do this in chroot with mounted proc, sys and dev)

I'd rather install a base system and not be bothered with copying things, it probably takes shorter time to set it all up from scratch than to wait for cp or rsync to finish and to adjust and tweak the little things (fstab, permissions, fucking around with GRUB and the UUIDs) -- but that's just my opinion :)

Edit; removed shit
..gnutella..

User avatar
wuxmedia
Grasshopper
Posts: 6454
Joined: Wed Oct 17, 2012 11:32 am
Location: Back in Blighty
Contact:

Re: moving a working partition over to a new device.

Unread post by wuxmedia » Tue May 05, 2015 10:39 am

Thanks for your input, yeah maybe it is about the same to get a base (xubuntu, company policy) install working on there. then cp the configs and ssh keys over, as it will be a mount away and a few cp's should get me up to speed.
it may even encourage me to make a 'script' for apt-get.
one shot to get all the things I like having on my systems to obviate this kind of thing in the future.

PS. need to open the box and plug it in first!
"Seek, and Ye shall find"
"Github | Chooons | Site"

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: moving a working partition over to a new device.

Unread post by machinebacon » Tue May 05, 2015 10:50 am

guess btrfs can do what you want
..gnutella..

Post Reply