2

It says my hard drive is about to fail and that it's reached temperatures of 93F, so i want to have everything backed up and ready for if or when it fails. i know of ways that i can save a back up copy to the hard drive, but i'm not sure about a USB or how i would go about reuploading it to a new hard drive.

  • How much data? If you have a USB drive that's large enough, deja-dup will make backups easy. – Jeff K Mar 14 '21 at 18:50
  • 4
    Whatever you do, turn off your computer for about an hour to allow it to cool down before you do it. Copying everything will likely heat up your drive to the highest it has every been and could lead to failures. As such a program that lets you resume copying from where you left off (like rsync) is the best choice. Another option is this script which uses rsync. – WinEunuuchs2Unix Mar 14 '21 at 23:40
  • 3
    I also very strongly recommend that you back up only your home directory first. If the drive fails, losing the OS is no big deal compared to losing your files. – chrylis -cautiouslyoptimistic- Mar 15 '21 at 05:01
  • Side note: making backups when your drive is about to fail is too late. You may not get a warning next time. Backups should be regular, frequent, automated and confirmed to be restorable. – gronostaj Mar 15 '21 at 07:54
  • 5
    93F doesn't seem like a particularly high temperature inside a computer - kinda warm but not really concerning? – user253751 Mar 15 '21 at 10:05
  • 2
    @PeterCordes 93F is 33.9C. 51 degrees C would be concerning for a hard drive (IMO). – user253751 Mar 15 '21 at 12:27
  • 1
    @user253751: oh derp, yes I used units and didn't sanity-check the result. 93 degF is 51 degC, but the scales have 0 at different points and units wasn't doing that. Yeah, 34C is a totally comfortable temperature for any HD to run at. 93 C on the other hand would be extreme, like fans failed zero airflow, and even then seems unlikely. – Peter Cordes Mar 15 '21 at 12:30
  • 2
    Just for the record, you can get more detail on your HDD status (including temp limits) with sudo smartctl -x /dev/sda or whatever path). A drive like a WD Red (NAS-rated) has an upper operating temp rating of 65 C, vs. 60 C for an old WD Green (WD10EADS), or only 55 C for a Seagate Barracuda Compute (ST6000DM003-2CY186). IDK if there are any drives that only rate themselves for operation up to 50C, but even that's still way higher than 34C. So if your drive is dying, a max temp of 34C is not the reason. If SMART says your drive is about to fail, back up now, but don't worry about temp. – Peter Cordes Mar 15 '21 at 12:34
  • @WinEunuuchs2Unix, I'd rather not power cycle such a harddisk and subject it to even more stress. – Simon Richter Mar 15 '21 at 18:50
  • @WinEunuuchs2Unix, by far the most likely time for a hard drive to fail is during startup. Turning off the computer is probably the worst thing you can do in this situation. – Mark Mar 15 '21 at 20:36

2 Answers2

8

In my opinion the easiest tool to achieve this task is Clonezilla

For that purpose you'd need:

  • One smaller USB stick or a CD or some other storage device to boot Clonezilla from - the website has pretty good instructions and there are numerous instructions on the web how to do it;
  • One large USB stick, external HDD, NAS or a similar storage space to store the image of your hard drive on.

You then boot Clonezilla, choose "Device to Image" option and run the backup.

You can then replace your hard drive with a larger one and reverse the process: boot Clonezilla, select "Image to Device" and restore backup.

The PC should start normally and you would not see any differences. You can then use GPartEd to enlarge the partitions to use the extra space.

The process is pretty straightforward.

Note: cloning to a smaller drive is not supported and, although possible, is rather hacking and I'd highly discourage it. Especially if the drive is actually failing.

Pawel Debski
  • 2,704
  • 8
  • 28
  • 40
2

Do not bother spending the time to back up an operating system. Operating systems can be downloaded for free anytime, and are reinstalled in less than an hour.

What you need to bother about, is your personal files. These are unique and irreplaceable. Once lost, these are lost forever. Therefore, you should, anytime, have good backup copies of your data (on external USB, in the cloud, ...). Once that is in place, a heating hard disk is a relatively minor problem.

A backup can be as simple as copying your personal files to a backup medium. To restore them, you copy them back. That, however, may take a long time, preventing you to backup regularly. Therefore, invest in an incremental backup system. There, only changed files are updated in the backup.

vanadium
  • 88,010
  • 2
    I'd hate to lose my crontab though. These are in /var/spool/cron and so would not be backed up in your procedure. Same goes for network settings in /etc, a couple of useful scripts in /usr/local/bin...can think of a few more. – Jos Mar 15 '21 at 14:38
  • @Jos I think that is one of the advantages of the nixos operating system. You can achieve similar in ubuntu by using scripting the setup and configuration of your crontabs. Just write a script "setup-crontabs.sh" and another script "wipe-crontabs.sh". You can store the scripts in ~/bin (backed up as a personal file) or keep it in its own repo. – emory Mar 15 '21 at 18:20
  • @Jos yeah, I'd want /var, /usr, /etc, /home, and for a server, /srv. There's plenty of noise in with the signal, but it's way better than realizing after it's too late that you needed something not in your backup. – Jared Smith Mar 15 '21 at 18:20
  • 1
    @JaredSmith, you don't need all of /usr. If you've been installing things correctly, all you need is /usr/local. – Mark Mar 15 '21 at 20:37
  • @Mark good point, but what about /usr/share? I work on different Linuxes but I seem to remember stuff I actually need being in /usr/share on Ubuntu? – Jared Smith Mar 15 '21 at 21:22
  • 1
    @JaredSmith, /usr/share should be entirely files installed by the package manager. – Mark Mar 15 '21 at 21:27