Finding out specific disk/SSD/M.2 capacity and structure

0

I am trying to dd from one disk (SSD 1TiB) to a new M.2 of same size (allegedly 1TiB).

The source SSD contains 3 partitions, UEFI, / OS (Ubuntu 18.04.x latest) and /home, hence I don't want to create partitions again, but just do:

  • dd SSD to M.2
  • change fstab
  • use the old SSD for something else

Hence my question is, how do I find out the exact size and structure of my SSD and M.2?

I wouldn't want to execute dd and then find out I have truncated data/partition on the M.2 to then have to do a proper install from scratch.

Emanuele

Posted 2019-08-24T09:04:50.940

Reputation: 661

Answers

2

The easy way: Just run GPartEd on both disks. It will give you blocksizes and capacity for both so you can compare. And you can do the partition copies (and resizing if needed) from there to.

If you don't have a GUI available, use a GPartED live-cd.

If you need to go completely without GUI (headless system, only have a shell-login) you can still get the capacity via the commandline using any of the commandline partioning and/or disk-info tools.
See this question (and its duplicates) on the Unix StackExchaneg site.

Tonny

Posted 2019-08-24T09:04:50.940

Reputation: 19 919

Thanks, I think I'll use disk-info, though having GParted may be a good idea in case size is not a good match! – Emanuele – 2019-08-24T10:15:43.277