LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-26-2022, 05:18 AM   #1
ychaouche
Member
 
Registered: Mar 2017
Distribution: Mint, Debian, Q4OS, Mageia, KDE Neon
Posts: 369
Blog Entries: 1

Rep: Reputation: 49
Angry using dd co copy some partitions b/w 2 disks


Hello all,

I've been thinking about cloning my entire disk to a new disk,
but there are some partitions I do not wish to keep.
old disk is as follows :

Code:
11:03:14 ~ -1- $ sys.disk.partitions.list
[sudo] password for ychaouche:
Model: ATA WDC WD10EZEX-00W (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos

Number  Start   End     Size    Type      File system     Flags
 1      1049kB  106MB   105MB   primary   ntfs
 2      107MB   48.8GB  48.7GB  primary   ntfs
 3      315GB   629GB   315GB   primary   ntfs
 4      629GB   1000GB  371GB   extended
 5      629GB   649GB   20.0GB  logical   ext4
 6      649GB   729GB   80.0GB  logical   ext4
 7      729GB   737GB   7999MB  logical   linux-swap(v1)
 8      737GB   764GB   26.3GB  logical   ext4
 9      764GB   808GB   44.6GB  logical   btrfs           boot


11:03:20 ~ -1- $
Partitions I'd like to copy on second disk are :
3, 5, 6, 7 (swap), and 8.

I'm not sure how to procede.

Suggestions?

EDIT : the only reason I'd like to copy the swap partition is to speed up the cloning process so that I don't have to create it manually on the destination drive.
But if that's not doable, I'll do it manually afterwards.
I am particularly concerned about the partition table on the destination drive.
If I dd if=/dev/sda of=/dev/sdb then the partition table will be copied, right?
should I use a graphical tool instead?

Last edited by ychaouche; 10-26-2022 at 05:22 AM.
 
Old 10-26-2022, 05:32 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,418

Rep: Reputation: 2339Reputation: 2339Reputation: 2339Reputation: 2339Reputation: 2339Reputation: 2339Reputation: 2339Reputation: 2339Reputation: 2339Reputation: 2339Reputation: 2339
I'd suggest formatting as desired, rsync your chosen partitions. Don't dd them, because dd will copy normally invisible and unwanted items, not just the information.
 
Old 10-26-2022, 06:27 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,147

Rep: Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124
Quote:
Originally Posted by ychaouche View Post
: the only reason I'd like to copy the swap partition is to speed up the cloning process so that I don't have to create it manually on the destination drive.
Short-cutting will lead to grief - not just swap, but all of it. dd is just about the worst option - see post above.

Clonezilla was invented for tasks like this - it will save you from yourself.
 
Old 10-26-2022, 08:27 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,997

Rep: Reputation: 7338Reputation: 7338Reputation: 7338Reputation: 7338Reputation: 7338Reputation: 7338Reputation: 7338Reputation: 7338Reputation: 7338Reputation: 7338Reputation: 7338
swap should be created again, that is much faster than copying it (and much safer too). Anyway probably the best way is to use clonezilla (as it was already mentioned)
 
Old 10-26-2022, 08:51 AM   #5
ychaouche
Member
 
Registered: Mar 2017
Distribution: Mint, Debian, Q4OS, Mageia, KDE Neon
Posts: 369

Original Poster
Blog Entries: 1

Rep: Reputation: 49
Thank you all for your quality answers.
Much appreciated!
 
  


Reply

Tags
dd, disk, disk clone



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Grub refusing to show some Hard disks and or partitions spnoe Linux - Hardware 6 04-09-2021 11:32 AM
Usage VBoxManage to copy partitions to virtual disks Ubuntero Linux - General 1 12-12-2018 07:52 PM
Want to change how pasted files are named "(copy)," "(another copy)," "(3rd copy)" L a r r y Linux - Desktop 3 08-24-2013 03:39 PM
Using dd to copy specific partitions into specific partitions? katto Linux - Software 15 11-14-2010 07:57 AM
Partitions, partitions, partitions..... Clueless in VA Linux - Newbie 7 08-08-2001 03:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration