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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
09-06-2019, 12:26 PM
|
#1
|
LQ Newbie
Registered: Dec 2007
Posts: 10
Rep:
|
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?
|
|
|
09-06-2019, 01:31 PM
|
#2
|
LQ Addict
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680
|
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.
|
|
|
09-06-2019, 02:01 PM
|
#3
|
LQ Newbie
Registered: Dec 2007
Posts: 10
Original Poster
Rep:
|
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
|
|
|
09-06-2019, 02:14 PM
|
#4
|
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
|
backup configs and personal customizations, saves time redoing everything.
|
|
|
09-06-2019, 02:45 PM
|
#5
|
Member
Registered: Aug 2007
Posts: 483
Rep: 
|
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.
|
09-06-2019, 02:55 PM
|
#6
|
LQ Newbie
Registered: Dec 2007
Posts: 10
Original Poster
Rep:
|
Quote:
Originally Posted by tofino_surfer
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?
|
|
|
09-06-2019, 03:03 PM
|
#7
|
Moderator
Registered: Mar 2008
Posts: 22,361
|
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.
|
|
|
09-06-2019, 03:33 PM
|
#8
|
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
|
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.
|
|
|
09-06-2019, 04:26 PM
|
#9
|
Member
Registered: Aug 2007
Posts: 483
Rep: 
|
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.
|
|
|
09-06-2019, 04:45 PM
|
#10
|
Senior Member
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683
|
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.
|
|
|
09-06-2019, 05:01 PM
|
#11
|
Member
Registered: Aug 2007
Posts: 483
Rep: 
|
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.
|
|
|
09-06-2019, 05:38 PM
|
#12
|
Moderator
Registered: Mar 2008
Posts: 22,361
|
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.
|
|
|
09-06-2019, 09:45 PM
|
#13
|
Member
Registered: Aug 2007
Posts: 483
Rep: 
|
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.
|
|
|
09-07-2019, 04:30 AM
|
#14
|
Senior Member
Registered: Dec 2011
Distribution: Slackware
Posts: 1,834
|
Quote:
Originally Posted by lostaccount
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.
|
|
|
09-07-2019, 05:08 AM
|
#15
|
Senior Member
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683
|
Quote:
Originally Posted by zeebra
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
|
|
|
All times are GMT -5. The time now is 02:34 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|