Linux Mint - Free and powerful

Wednesday, 16 May 2012

Ready to migrate to LMDE? What about my apps? Scenario 1: New HD, same OS, same version.

Here is a few pointers to make your life simpler.

Scenario 1: - New hard drive, same OS, same version 

Make a backup of your home directory. 

There are files in use so you need to logout and login with a different user or kill the GUI.

1. Press Ctrl+Alt+F1 to start a console session.

Don't panic, Ctrl+Alt+F7 or 8 or 9 should take you back to a GUI.

2. Now "kill" the GUI session using the console session to ensure all locked files are released.
/etc/init.d/gdm3 stop
3. Now copy your home directory to a backup in this example a USB3 device mounted as usb3disk1. Type in "df" to quickly see the disks.
sudo chown -R user:user /home/user/.
sudo chown -R user:user /home/user/*
cp -a /home/user## /media/usb3disk1/backups/home/user##.bckp
or use Rsync:
rsync -rptDuv -e /home/user##/* /media/usb3disk1/backups/home/user##.bckp 

Get a list of all your applications. 

4. Dump a list of all the installed programs on your old system while still active.
dpkg -l | awk '{print $2}' >
/media/usb3disk1/backups/home/user##/installed_packages.txt 

Install a new bigger hard drive.

5. Shutdown and remove the old hard drive.
sudo shutdown -h now
 Keep the old drive safe as experience has taught me.


6. Install the new hard drive.

7. Use gparted to create the partitions as required.
sudo gparted
Can you add a directory? of course not, this is linux, nothing is easy. :-)

8. You need to give yourself access to the drive first. Start a terminal session and type this:
sudo -i
chown -R username:username /media/mynewdisk/.
chown -R username:username /media/mynewdisk/*

Restore your home directory. 

9. Move (or copy) the backup home directory to the new disk.
mv /media/usb3disk1/backups/home/user##.bckp /home/user##
or use Rsync

rsync -rptDuv -e /media/usb3disk1/backups/home/user##.bckp/* /home/user##

Re-install your applications.

10. re-install all packages. This is the magic!

sudo apt-get install `cat /media/usb3disk1/backups/home/user##/installed_packages.txt`

Did that work? No? Enclose the command in " ` " and not in " ' " :-)

New bigger hard drive? DONE!

Next in this series: New hard drive, new OS, new version. 

0 comments :

Post a Comment

Thank you for taking the time to comment. Your opinion is important and of value and we appreciate the positive feedback! If you are "Negative Nancy" then please do us, and humanity, a favor, and piss off.

Total Pageviews

Google+ Followers

Pages

Blog Archive

Popular Posts

Recent Comments

Rays Twitter feed

Ads

Web sites come and go and information is lost and therefore some pages are archived. @rayd123. Powered by Blogger.