-1

To elaborate on the title, I just want my documents (text, media or whatever) to be safe from deletion in case of a re-installation of Ubuntu and at the same time to remain accessible now. Just as things are in Windows: no matter how many times you re-install the OS in c:, the data in other partitions remain intact.

At the time of installing the Ubuntu, I did create extra partitions for the purpose but couldn't mount them. I was warned that the partitions, unless mounted, would be unusable (and that is what has happened), but I wasn't sure where to mount them: /usr, /usr/local? Some answers to similar questions in this forum seem to suggest /data or /workdata as mounting points, but I don't remember any such options offered during installation. I have even gone half-way through a mock re-installation but still haven't found those options.

By way of a bit of extra information, I have used Ubuntu 14.04 for a number of years. It was installed in the c: drive of a Windows system, and all the other partitions remained intact, in the form of 'media/.../ntfs'. They wouldn't mount at booting, but their icons showed up on the launcher. A click would mount them and the Ubuntu system could freely communicate with them. A similar configuration will do for me.

I would be grateful for any useful advice from anyone more experienced than me.

user255726
  • 353
  • 3
  • 6
  • 20
  • You can re-install Ubuntu Desktop without loss of desktop (assuming you don't erase and install or pick the right options) regardless of whatever partitioning layout you use. You don't need a special layout to enable this. I've re-installed systems hundreds of times (including QA-testing (Quality Assurance)) and not had issues - however yes it's easy to pick the wrong option (key is to not use any option that does not format) - but your intended use-case is a tested install. if you don't know the option - use Something else and ensure you don't format... – guiverc Jul 05 '21 at 10:54
  • You can re-install Ubuntu Desktop without loss of files (I wrongly said desktop... Only system directories are erased... and given desktop systems store all files in $HOME, it isn't touched unless you use an install that formats). Even additional packages you had installed can be auto-re-installed with the correct options; but desktop user files are not touched.. Some server apps configs don't survive (as they exist inside system directories), but the re-install without touching files is great for desktop systems. – guiverc Jul 05 '21 at 11:04
  • Forgive me, I don't understand "...without loss of desktop". Do you mean data stored in /home (or /root?) will not be lost in the event of a re-installation? Could you be a bit more clear as to which space exactly should it be? And I would like that space itself to have a few partitions. – user255726 Jul 05 '21 at 11:07
  • /root won't be touched (not a system directory), neither will /home, or any directory you create.... /usr, /lib, /bin etc will have contents erased (why server apps which can store .conf files in those directories are not included; but I was talking Ubuntu desktop not Ubuntu server).. your packages are noted, system directories are erased, new system installed, then your additional packages added back (if available in new release) without touching any user file - as long as you don't format... regardless of partition strategy used). It's something else when no-format is selected – guiverc Jul 05 '21 at 11:10
  • From your later answer it seems files stored in /home would remain untouched by re-installation. Right? If so, how to have more than one partition for the purpose? – user255726 Jul 05 '21 at 11:11
  • Partition layout does not matter - key is do not format... If you select format, data is erased... A separate partition, six partitions, or single partition makes no difference - key is any partition that is formatted will have data erased so don't erase partitions (select & ensure format is not ticked). Use the Something else and use whatever scheme you like (or use gparted, KDE partition manager or whatever program you like to create partitions, then just select them with the installer but don't format them... – guiverc Jul 05 '21 at 11:13
  • Thanks a lot. I hope I understand more now. For these document-storing partitions should I stick to Ext4 file system or switch to NTFS (as it was with me before)? Any relative advantages/disadvantages? – user255726 Jul 05 '21 at 11:22
  • Little hints: I prefer creating partitions first using tools like I mentioned in prior comment (I find it easier than in ubiquity, calamares or whatever installer is being used; ubiquity for Ubuntu Desktop), and create there. If for example I want to split a 80GB disk half for system & half for user data, I'd not give 40GB to each, but create two partitions 39 & 41GB as it's easier to find them when they're not the same size (sizes only example). I'd not use a foreign (NTFS) layout, but ext4 or a fully POSIX compliant fs to avoid problems... NTFS is for windows – guiverc Jul 05 '21 at 11:24
  • Thanks for your repeated caution against formatting/erasing for protecting my data and your advice regarding NTFS. For the peace of my mind please advise: 1) w – user255726 Jul 05 '21 at 11:54
  • Thanks for your repeated caution against formatting/erasing for protecting my data and your advice regarding NTFS. For the peace of my mind please advise: 1) would all data stored in /home (or even, say, /root) remain unaffected by re-installation? 2) can anything -- /user, user/local, or even another /home be chosen as mounting points for the extra partitions? – user255726 Jul 05 '21 at 12:02
  • Your (1) already answered; if you format it's erased; if no-format it's not touched. /user is very different to /usr; /user is not touched unless formatted. – guiverc Jul 05 '21 at 22:21
  • Right. Thanks a lot. – user255726 Jul 06 '21 at 09:21

1 Answers1

2

You create partitions while partitioning your drive. You apparently did that.

Partitions then need to contain a file system. To achieve that, a partition is formatted.

In Ubuntu, a formatted partition on an internal drive will not be automatically mounted. It will, however, be visible as an icon in the left pane of the file manager, and can be mounted on demand, i.e., by clicking on that icon. A formatted partition on an external USB drive will be automounted when the drive is inserted.

Ubuntu comes with the utility "Disks" (command: gnome-disks). It allows you to

  • Partition a drive or change partitions on a drive;
  • Format partitions;
  • Set partitions to automount during startup.

With these tools, you can obviously create a separate partition for data storage if you wish so, format it with an available file system of your choice, and configure it like you prefer, i.e. have it automount or only on demand.

vanadium
  • 88,010
  • Thank you very much. Your answer clarifies several unanswered questions in my mind. I will format the as yet empty partitions created by me and see what happens. Will I be asked to choose a mounting point and in that case which to choose? – user255726 Jul 05 '21 at 12:10
  • You will see them in file manager. In case you configure to automatically mount during startup, you need to indicate the directory where you want to mount – vanadium Jul 05 '21 at 13:13
  • Your responses have been accurate and extremely helpful and everything has worked out beautifully. Just one more query. If I hadn't gone for the extra partitions, where would my apps and documents be stored -- /root? /home? And would they be preserved in case of a re-installation of the OS as long as I didn't format/erase the relevant partition? It does seem so, going by another very patient respondent's explanation, but I just want to be absolutely sure. – user255726 Jul 06 '21 at 09:33
  • User docs by default are under your home directory. By default, /home is on the root partition. One can set /home to be a separate partition or, your case, only data storage on a separate partition. – vanadium Jul 06 '21 at 09:39
  • And these docs will remain unharmed by a re-installation of the OS? – user255726 Jul 06 '21 at 09:42
  • If you do not overwrite them by your installation: no. – vanadium Jul 06 '21 at 11:58