The Problem
There will be a day when Linux stops working, booting or just has a random problem. Sometimes it may require hours of research, posting questions and trial-n-error to fix it. It is good to learn how to fix issues, but sometimes you are in a pinch and need it fixed quickly.
The solution
Install Linux in the free space on your hard drive, then set your old Mint as your /home
When most people install Linux they end up using the entire hard drive as a single partition. This is the easy way to get it installed quickly and efficiently, but there is a downside...
There is a plethora of issues that can happen to your computer just like with Windows or Mac. I found a fairly quick and painless way to rescue your operating system and data without a lot of trouble.
- What if Linux will not boot?
- What if Grub stops working?
- What if it keeps crashing?
Outline
Step 1
- Install Live Disk on a USB Drive
- Install Linux on hard drive free space
- Mount old Linux partition
- Move /home to root
- Get Parition UUID
- Edit FSTAB
- Install missing applications
- Configure missing settings
Install Linux on a USB drive
If you don't already have a USB drive with Linux Live Disk on it, get one!
USB drives are fairly cheap these days and you only need one that is around 4GB or more.
Download your favorite distro (Mint Cinnamon) and use a spare computer or friends computer to install Live Disk on it. Chances are, you have already done this before. Just get the newest version of your Distro on it.
Boot to the USB Drive
Step 2
Install Linux on free space
Warning!!
This step is very important because you can accidentally erase your existing Linux partition and all of your files.
Please double-check everything before continuing! There is no turning back once you begin the installation.
Linux Mint 19.3 has a great installer with an option to install Linux along-side your old Linux. It basically uses the free-space on your hard drive
This is the quickest and easiest way to install Linux Mint again, granted you have enough free space.
If you do not have free space, mount the old Linux partition and start deleting files you don't need. Again be careful as you don't want to delete your /home, games pictures, videos, etc.
Note: If this option isn't available, you can use gparted during your Live Disc session to add free space to your hard drive, then be sure to install Linux on the free space.
Continue with the installation and Reboot
Step 3
Mount Old Linux Partition
In Mint you can open a Window and the left column should display any drives available. Click the drive for your old Linux installation. Mint should mount it and give you a shortcut on your desktop.
Step 4
Mount Old /home as the Partition Root
If you are like me, you have hundreds of Gigabytes in games, pictures and videos. There is no way its all going to fit in the new Linux partition. So we are going to keep that old partition and make it your new /home.
Step 5
- Navigate to your old Linux partition
- Create a new temp folder in the root of the partition
- Select everything but /home
- Move or cut-n-paste all the system folders into the temp folder
- Open /home
- Cut and paste your personally named home folder /home/username into the root of the old partition
- Now the partition should only show two folder: temp & username
Get UUID of Old Partition
In order to automatically mount the old partition as /home we need the UUID
- Open Menu
- Type: disk
- Select the old partition (disk)
- Copy the UUID
Step 6
Edit /etc/fstab (File System Tables)
There are several ways to edit the file system tables in Linux. You can do it from the Terminal with nano or you can open it in Text Editor (easy way)
- Open a folder in Mint
- Click "File System" in the left column
- Right-Click etc Folder
- Click "Open as root" (may show "open as administrator")
- Enter your password
- Find fstab
- Right-click fstab
- Open with
- Find Text Editor on the list
- Add new mount using UUID
fstab - File System Table will probably look strange, but we are going to just add one more line at the bottom.
Click at the bottom and follow these steps:
It should look similar to this
- Type a note: # Old Linux Home
- Press Enter
- Type: UUID=paste-ID-here
- Press Tab
- Type: /home
- Press Tab
- Type: ext4
- Press Tab
- Type: defaults
- Press Tab
- Type: 0
- Press Tab
- Type: 0
- Save fstab
Note: Its ok if the ext4 defaults 0 0 do not line up with the devices above them
Reboot!
If everything is setup appropriately your next reboot should display your old Desktop files, shortcuts, icons, wallpaper and everything else you setup before.
Step 7
Install Missing Applications
Inevitably there are going to be some applications you installed previously are now missing.
I had to install the following for my Mint gaming PC:
- Mint Updates
- Nvidia 430 Drivers
- Google Chrome
- ia32-libs
- xterm
- Steam
- PlayOnLinux
- Wine-Stable
- GZDoom
- Minetest
Step 8
Check Configurations and Settings
Some settings have probably defaulted to the Mint standard setup. You will have to visit the System Preferences to set them up again:
- Power Options
- Panel Settings
- Favorites
- Apps on Panel
- Network Settings
- Login Screen
- Themes
Conclusion:
Once everything is setup and installed, you should have a new system read to use. Hopefully this only costs you and hour or so to get going again. I was just very happy to not download 100GB of PlayOnLinux/Steam games and installing shortcuts. This would have taken a few days to get all setup again.
Comments
Discussion in 'Linux Guides (Generic)' started by booman, Mar 18, 2020.
XenPorta
© Jason Axelrod from 8WAYRUN.COM