Hi Tim,

> > > (current hard disk is 500gb - formating etc.) and I am looking at
> > > fitting a 250gb ssd.
>
> Disk /dev/sda: 500107862016B

    $ units 500107862016B bytes
            465 GiB + 780 MiB + 24 KiB

> Sector size (logical/physical): 512B/4096B
>
> Number  Start          End            Size           Type     File system     
> Flags
> 1       1048576B       49217011711B   49215963136B   primary  ext4            

Its end is well within the area of the new smaller SSD.

    $ units -1 49217011711B bytes
            45 GiB + 856 MiB + 1023 KiB + 1023 B

> 2       49217011712B   468647411711B  419430400000B  primary  ext4            

And that covers most of the rust, starting from the end of sda1,

    $ expr 468647411712 - 468647411711 - 1
    0

and going nearly to the end, just before the swap.

    $ units -1 468647411711B bytes
            436 GiB + 472 MiB + 1023 KiB + 1023 B

> 3       468647411712B  500105249279B  31457837568B   primary  linux-swap(v1)  

If you're not dependent on that swap then you could delete that
partition before the transfer so it's less to do, creating a new one on
the SSD, if you think it's worthwhile.

> df -k /dev/sda?*
> Filesystem     1K-blocks     Used Available Use% Mounted on
> /dev/sda1       47045404  5712048  38913852  13% /
> /dev/sda2      402123024 23220796 358405844   7% /home
> udev             3890100        0   3890100   0% /dev

Adding the amount used of sda2, /home, onto its starting point as a
rough guide doesn't get us far into a 250 GB SSD.

    $ units -1 49217011712B+23220796KiB bytes
            67 GiB + 1005 MiB + 572 KiB

So I'd

    - Delete the swap partition unless the machine is crippled without
      it.
    - Boot from a recent live USB stick that offers gparted.
    - Use gparted to shrink /home so its end is comfortably under a
      250 GB SSD's limit.

Then the content you wish to copy will fit on the smaller destination.
How you do the copy comes down to personal preference a bit.
I'd dd(1), but you might be more use to something else?

-- 
Cheers, Ralph.

-- 
  Next meeting: BEC, Bournemouth, Tuesday, 2019-09-03 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk/
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk

Reply via email to