LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 09-06-2019, 12:26 PM   #1
lostaccount
LQ Newbie
 
Registered: Dec 2007
Posts: 10

Rep: Reputation: 0
Conventional hard disk to SSD


My laptop has a conventional 2.5" 500gb hard disk and I intend to swap this out for a 250gb ssd.

I want to image the current install I have and then restore it to my ssd. I only have three partitions, root, home & swap.

What I propose to do it to shrink the current home so that it is close to what I want on the SSD. Then do the same for the root partition. I will make a new swap with the remaining space on the ssd.

I want to use DD to do the imaging (booting the laptop from a boot disk).

So here are the bits I am not so clear on,

1) Do I leave the SSD with no partitions on it and allow the imaging to set the partition?

2) Once I have the partitions moved over to the SSD I reinstall grub to sda (assuming it is sda), their is no efi on this laptop?

Can anybody see anything wrong with this approach, I know there are other ways of doing it but I have got this approach set in my head and unless there is something disastrously bad\wrong with what I want to do I would prefer to do it this way.

Any thoughts, comments?
 
Old 09-06-2019, 01:31 PM   #2
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
Just reinstall from scratch. It's likely your approach will work just fine and you won't have any issues but another pass at installing the OS after you've done it before is a good thing for learning. Plus, much more straightforward to start anew.
 
Old 09-06-2019, 02:01 PM   #3
lostaccount
LQ Newbie
 
Registered: Dec 2007
Posts: 10

Original Poster
Rep: Reputation: 0
The current install is only a couple of months old and as I have got it where I wanted it. I am looking at trying the imaging game for practice, I have installed quite a few distro's and have done so in the past in preference to imaging, so now is the time to play with imaging. Worst come to the worst, I will reinstall
 
Old 09-06-2019, 02:14 PM   #4
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
backup configs and personal customizations, saves time redoing everything.
 
Old 09-06-2019, 02:45 PM   #5
tofino_surfer
Member
 
Registered: Aug 2007
Posts: 483

Rep: Reputation: 153Reputation: 153
Quote:
I want to use DD to do the imaging (booting the laptop from a boot disk).
I recommend using rsync instead. Simply create new smaller empty EXT4 filesystems on the SSD and rsync the data from / and /home. If the original filesystems are less than half full it should fit. If not you would have trouble shrinking them anyway. There would be no need to shrink anything on the original HDD.

Even though your SSD is small and you are using legacy BIOS I recommend using GPT as it is much more modern. I have a BIOS/GPT system with a 250 GB SSD. For grub you will need to create a 1MiB partition at the start of the disk with a flag of bios_grub.

Quote:
Just reinstall from scratch. It's likely your approach will work just fine and you won't have any issues but another pass at installing the OS after you've done it before is a good thing for learning. Plus, much more straightforward to start anew.
You will learn much more by doing a disk cloning such as this instead of idiotically re-installing everything each time.

Quote:
The current install is only a couple of months old and as I have got it where I wanted it. I am looking at trying the imaging game for practice, I have installed quite a few distro's and have done so in the past in preference to imaging, so now is the time to play with imaging.
Exactly, it is time to learn about imaging although I do recommend creating new empty filesystems and using rsync.

Last edited by tofino_surfer; 09-06-2019 at 04:09 PM.
 
2 members found this post helpful.
Old 09-06-2019, 02:55 PM   #6
lostaccount
LQ Newbie
 
Registered: Dec 2007
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by tofino_surfer View Post
I recommend using rsync instead. Simply create new smaller empty EXT4 filesystems on the SSD and rsync the data from / and /home. If the original filesystems are less than half full it should fit. If not you would have trouble shrinking them anyway. There would be no need to shrink anything on the original HDD.



You will learn much more by doing a disk cloning such as this instead of idiotically re-installing everything each time.



Exactly, it is time to learn about imaging althogh I do recommend creating new empty filesystems and using rsync.
Now I never though of using rsync (thought about copying but that was going to be to much hassle), certainly sound like it would be a lot easier especially as the partition are different size and there is not a space issue.

I am guessing you boot from a boot disk, then run rsynce as sudo, then install grub?
 
Old 09-06-2019, 03:03 PM   #7
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,020

Rep: Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630
I might be tempted to use clonezilla.

Using dd is a raw disk access method. It will delete any information on target. One wrong move and the target may be the wrong one.. There is no are you sure, really sure, really really sure?

However, stated above is what I consider to be the best way. Just make a new clean install. I don't care if the system is two hours old. I never trust installers to be pure machine agnostic.
Best part is you have a complete working mechanical drive sitting there is case new drive simply won't work.

As in any clone you may have to adjust some variables or settings. The drive may have to be corrected for alignment. The block may be more suited to new geometry.
 
Old 09-06-2019, 03:33 PM   #8
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
two drives, 1 old, 1 new. install new on the new drive mount old drive and copy of what you need onto it, wipe old drive put into data storage mode. mount in fstab.
 
Old 09-06-2019, 04:26 PM   #9
tofino_surfer
Member
 
Registered: Aug 2007
Posts: 483

Rep: Reputation: 153Reputation: 153
Quote:
Now I never though of using rsync (thought about copying but that was going to be to much hassle), certainly sound like it would be a lot easier especially as the partition are different size and there is not a space issue.

I am guessing you boot from a boot disk, then run rsync as sudo, then install grub?
The rsync for / is best done from a live environment. rsync for /home could be done while booted into the old drive with /home unmounted although since you are using live for rsync / it is easy to do it at the same time. Installing grub could be done either from live or booted into the old drive.

Quote:
Just make a new clean install. I don't care if the system is two hours old. I never trust installers to be pure machine agnostic.
The OP does care as they don't want to lose customizations. This is what matters to them. What does "pure machine agnostic" have to do with rsyncing data to a new drive.

Quote:
As in any clone you may have to adjust some variables or settings. The drive may have to be corrected for alignment. The block may be more suited to new geometry.
With new partitions, filesystems and rsync this all goes away.
 
Old 09-06-2019, 04:45 PM   #10
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
I would be tempted to go with from scratch

and transfer the data ( like home ) later

I seem to recall there being a subtle difference between a spinning HDD and SSD
the filesystem automatically takes this into account during creation.

I may have simply made that fact up, or it may be outdated and no longer relevant.

still,
By the time you have agonized over the correct dd
Risked corruption due to a powercut while resizing partitions.
( ok, unlikely since you mention laptop )

you could have had a new system installed

most ( if not all ) of your customisations are in ~/.config

the UID/GID of you user(s) should match , since distro's start at same UID/GID

if your disrto is debian based and you have apt installed

you get get a list of packages you have installed manually ( not part of the base install ) with
Code:
apt-mark showmanual
so dump to a file
Code:
apt-mark showmanual > manualpkgs.list
and on the new install

Code:
while read pkgs;do printf "$pkgs ";done<manualpkgs.list
# please note the space --------^
to confirm list
then
Code:
sudo apt install $(while read pkgs;do printf "$pkgs ";done<manualpkgs.list)

tl;dr
fresh install
cp old home to new home
reboot

Last edited by Firerat; 09-06-2019 at 04:46 PM.
 
Old 09-06-2019, 05:01 PM   #11
tofino_surfer
Member
 
Registered: Aug 2007
Posts: 483

Rep: Reputation: 153Reputation: 153
Quote:
I seem to recall there being a subtle difference between a spinning HDD and SSD
the filesystem automatically takes this into account during creation.

I may have simply made that fact up, or it may be outdated and no longer relevant.
If you create new partitions and filesystems this is handled.


Quote:
still,
By the time you have agonized over the correct dd
Risked corruption due to a powercut while resizing partitions.
( ok, unlikely since you mention laptop )
I am not recommending any of this either. New partition table and new ext4 filesystems on the SSD and rsync is the way to go. You won't corrupt the existing HDD by simply copying its data with rsync.
 
Old 09-06-2019, 05:38 PM   #12
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,020

Rep: Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630
tofino_surfer, I never said rsync. Keeping the old drive intact will keep their setup intact.

The OP is not simply cloning a drive. They are moving to a new type of drive that could have some very important effects on their original system.

If they have only had the setup for a few weeks then it should be a trivial matter to use clean install and use some of the posted methods to replicate the old install.

A clean install will also remove any defects that may have gone into old system.

Getting practice on clean installs never hurt an advanced user.

If the OP wants it done right then my opinion is to do a clean install. If they want a hopefully simply way then consider a clone of some type. Clone software and ways have both pluses and minuses.
 
Old 09-06-2019, 09:45 PM   #13
tofino_surfer
Member
 
Registered: Aug 2007
Posts: 483

Rep: Reputation: 153Reputation: 153
Quote:
tofino_surfer, I never said rsync. Keeping the old drive intact will keep their setup intact.
I never said you did. It is I who am recommending rsync to copy the data from / and /home on their old drive to new / and /home ext4 partitions on the SSD. How would copying data from their old drive not keep their setup intact ?

I replied at post #5 recommending rsync instead of dd before your first post at #7. I was also responding to Firerat's post #10.

Quote:
The OP is not simply cloning a drive. They are moving to a new type of drive that could have some very important effects on their original system.
I am not recommending that they do any type of cloning just to copy all their data to new partitions. Perhaps you could enumerate some of these important effects.
 
Old 09-07-2019, 04:30 AM   #14
zeebra
Senior Member
 
Registered: Dec 2011
Distribution: Slackware
Posts: 1,834
Blog Entries: 17

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
Quote:
Originally Posted by lostaccount View Post

Any thoughts, comments?
You COULD do it that way, but it would take a long time to copy all system files (so many files, quite large and some error prone, sockets etc). Unless you have done alot of custom stuff on there and have special settings etc it's not worth it. It would take far less time to install a fresh distro on the new SSD disk and then DD the /home old to the /home new only. It would be alot easier.

That's unless you have put an enormous amount of work into your distro, and it would take an enormous amount of work to get it to the same state post-install.
 
Old 09-07-2019, 05:08 AM   #15
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
Quote:
Originally Posted by zeebra View Post
You COULD do it that way, but it would take a long time to copy all system files (so many files, quite large and some error prone, sockets etc). Unless you have done alot of custom stuff on there and have special settings etc it's not worth it. It would take far less time to install a fresh distro on the new SSD disk and then DD the /home old to the /home new only. It would be alot easier.

That's unless you have put an enormous amount of work into your distro, and it would take an enormous amount of work to get it to the same state post-install.
I wouldn't bother with dd at all

just a good old fashioned
Code:
cp -a /mnt/oldhome/<username> ~/
assuming the old disk was attached via usb or esata and its home mounted to /mnt/oldhome


I used to use rsync for local ( briefly ), but cp is just easier.

If the old drive can't be mounted on the laptop ( no external device )
rsync can play a part.

but since dd is being considered I assume @lostaccount has some way of mounting the oldhome


cp - for copying files
rsysnc - for synchronising with a remote
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
DOS - I neet 500+ K free of of Conventional memory czezz General 3 08-17-2010 10:37 PM
Conventional Memory? vikesh.u Linux - Kernel 5 05-08-2010 08:16 AM
kernel: how do pci-memory a conventional memory? vv40in Linux - Newbie 0 06-05-2008 02:55 AM
LXer: Quantum computing billions of times faster than conventional computing LXer Syndicated Linux News 0 11-24-2006 02:21 AM
Dualboot non conventional means. At0mic_PC Slackware 4 02-08-2004 04:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 05:53 PM.

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