It depends on how you've set up Ubuntu and what choices you make during the re-installation.
Of course, before going any further, back up!
First, about your current installation... Ubuntu is installed in the root partition (/). That partition will be erased. If your /home partition is separated, then you are fine. If it is just another directory in /, then yes, that too will be erased. If you don't know, then run
$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 - - - 2% /
/dev/sdb1 - - - 41% /home
This shows that my /home is separate from /. If /home doesn't appear, then it is part of /, and it will get erased. This is true for any other partition... If /etc, /var, etc. do not show up here, then it'll be erased along with /. You said you can't boot up so you probably cannot run the
df -h command, but you can use a boot disk and run
gparted to take a look at how everything is organized.
Anything of value in / that you want, you should use a boot disk and an external drive and copy it out manually.
During installation, you will be presented with the image here, under "Installation Type". You should pick "Something else". You will then be presented with images similar to those shown here. (I can't remember if it uses
gparted -- I think it does.) You'll be able to choose which partition is mounted as /, /home, and so far. The key here is to select your home partition to be mounted as /home but do not have it erased. / will be erased...there's nothing you can do about that.
In summary, you need to be weary of two things:
- Anything of value to you isn't currently in the root (/) partition. If it is, use a boot disk and either move it to an external drive or move it to another drive if you have more than one on the computer. Everything in (/) will be deleted.
- During installation, carefully select which drives are being erased. Ubuntu 18.04 no longer has a tmp partition. If memory serves, this means only two partitions will be marked as reformatted: (a) the root partition and (b) the EFI system partition which is mounted on /boot/efi . Anything else won't be erased, provided you are careful and select that option. (You can make a mistake and choose your /home partition to be mounted and erased.)
Hope this helps! I just had to go through this a month ago... Re-installation of Ubuntu took less than 15 minutes. Moving files out of the root partition to a place that won't be erased took well over a day. But, obviously, such preparation is worth it and I wouldn't rush it...