7

Currently I have Windows 10 operating system. I don't want to dual boot. I want to clear the C drive and install Ubuntu in it. I want to retain data in other drives. So I found this. In this he says we can do it. I just want to know, will there be any drawbacks/performance issues of keeping other drives and accessing data in them, over full hard disk format and installing Ubuntu? Also will I be able to install software/games in other drives if I run out of space in the C drive?

wjandrea
  • 14,236
  • 4
  • 48
  • 98
Manohar
  • 213
  • 5
    You do understand the difference between a partition (which is dividing a drive into multiple virtual-drives, so one disk-drive can have C: and a D: in windows speak), and a directory (a folder on a file-system which is on a partition which is stored in a drive/disk). Your question seems to mix up directories & partitions. – guiverc Jan 12 '19 at 08:10
  • 1
    Wait let me edit properly – Manohar Jan 12 '19 at 08:12
  • 1
    @karel will there be any performance difference ? If I format all drives make remaining space as /home over keeping previous windows drives ? – Manohar Jan 12 '19 at 08:18
  • 1
    NTFS is not suitable for a home partition, because there are certain type of file system objects (character devices, named pipes, etc.) which are required for certain services but are not supported on NTFS. Quoted from: Using a folder on an ntfs partition as /home – karel Jan 12 '19 at 08:19
  • 1
    @karel thanks just a last question , suppose ubuntu ran into some problem , would I be able to retain data in /home directory if I want to install windows/ubuntu again ? . also Please add your answer I will accept it . – Manohar Jan 12 '19 at 08:23
  • 2
    Where is your data installed? – Paul Benson Jan 12 '19 at 08:34

3 Answers3

10

Starting in 17.04 new installations of Ubuntu use a swap file instead of a swap partition, so everything is installed on a single ext4 partition by default including the /home directory. This makes the most efficient use of valuable disk storage space on SSDs in situations in which Ubuntu is installed on an SSD. In situations where there are multiple hard disks or partitions there are ways listed below of making efficient use of the storage space on the other partition(s) too.

Suppose Ubuntu ran into some problem, would I be able to retain data in /home directory if I want to install Windows/Ubuntu again?

You can reinstall Ubuntu without losing data in /home even without a separate /home partition. See the following Ubuntu documentation links.

Will there be any performance difference if I format all drives and make remaining space as /home over keeping previous Windows drives?

NTFS is not suitable for a home partition, because there are certain type of file system objects (character devices, named pipes, etc.) which are required for certain services but are not supported on NTFS. Quoted from: Using a folder on an ntfs partition as /home

You can use custom folders for folders in /home in order to span your home directory across multiple hard disks.

Example (xdg-user-dirs-update - Update XDG user dir configuration):

 xdg-user-dirs-update --set DOWNLOAD /media/Redman/2nd-HDD/Downloads/

would switch from /home/$USER/Downloads/ to /mediaRedman/2nd-HDD/Downloads/ and downloaded files would then download to the 2nd HDD. The same applies for all the other directories.

Both the local ~/.config/user-dirs.dirs and global /etc/xdg/user-dirs.defaults configuration files use the following environmental variable format to point to user directories: XDG_DIRNAME_DIR="$HOME/directory_name" An example configuration file looks like this (these are all the template directories):

Results of cat ~/.config/user-dirs.dirs :

XDG_DESKTOP_DIR="$HOME/Desktop"
XDG_DOCUMENTS_DIR="$HOME/Documents"
XDG_DOWNLOAD_DIR="$HOME/Downloads"
XDG_MUSIC_DIR="$HOME/Music"
XDG_PICTURES_DIR="$HOME/Pictures"
XDG_PUBLICSHARE_DIR="$HOME/Public"
XDG_TEMPLATES_DIR="$HOME/Templates"
XDG_VIDEOS_DIR="$HOME/Videos"

As xdg-user-dirs will source the local configuration file to point to the appropriate user directories, it is therefore possible to specify custom folders. For example, if a custom folder for the XDG_DOWNLOAD_DIR variable has been named $HOME/Internet in ~/.config/user-dirs.dirs any application that uses this variable will use this directory.


What about in case I want to go back to Windows, can I retain /home data?

The Windows installer overwrites the entire partition that it is installed on, and will overwrite GRUB on MBR systems preventing Linux operating systems from booting. For this reason it is recommended to install Windows before installing Ubuntu in a dual boot.

karel
  • 114,770
  • what about in case I want to go back to windows can I retain /home data ? – Manohar Jan 12 '19 at 08:35
  • @Redman, If you consider going back to Windows, I suggest that you make a full backup of Windows before doing anything else. The simple case is to simply remove the current Windows drive and keep it as backup, but you can also make a backup image with Clonezilla. – sudodus Jan 12 '19 at 08:39
  • 1
    @karel thanks ,Windows is having too many privacy issues so I am moving away from it, even thought I an not good with linux and its commands . I will just format every thing and make remaining space as /home and would not look at windows back again . – Manohar Jan 12 '19 at 08:47
  • That is the reason I don't even want to dual boot – Manohar Jan 12 '19 at 08:48
  • "The Windows installer overwrites the entire disk that it is installed on" - that's completely false. All Windows versions since 2000 make you select single partition for installation. It won't even format that partition unless you tell it to and no other partitions are modified. Installation order matters for completely different reason: GRUB will detect Windows and let you boot it, but Windows loader will overwrite GRUB on MBR systems preventing Linux from booting. – gronostaj Jan 12 '19 at 19:05
5

If you keep partitions with the NTFS file system, you can mount them from linux with read and write access, but there are downsides.

  • The linux drivers for NTFS are robust, but not as efficient as linux drivers for linux file systems or Windows drivers for Windows file systems. So things will be slower than if you create ext4 file systems and copy your data files from the NTFS file systems (maybe via a backup drive).

  • The ownership and permissions are not flexible, when managed by the linux drivers from NTFS (and FAT32 and exFAT). They are set during mounting, to be the same for all files and directories, and cannot be modified unless you remount the file system.

  • Some special features of linux cannot be managed by NTFS. You should have linux file systems for all partitions belonging to the Ubuntu system: root (/), and if you have a separate home partition (/home) etc.

  • There are no good maintenance tools for NTFS in linux, so you cannot repair it or keep it fresh, except with Windows.


But in a dual boot scenario, it can be a good idea to have a separate data partition with NTFS. It can be accessed from Ubuntu as well as from Windows.

sudodus
  • 46,324
  • 5
  • 88
  • 152
4

Preliminary remark: You can preserve your data only if they currently are on separate partitions than the one known as the C drive.

You can indeed overwrite your partition, known to Windows as the c-drive, with the Ubuntu GNU/Linux operating system, and leave the other partitions in place. There are, however, issues in maintaining ntfs partitions on a computer where MS Windows is not installed.

Windows has its own file system, ntfs. All your current partitions, therefore, are most likely formatted in the ntfs file system format. Windows also supports vfat, so it is not excluded that some of your partitions are formatted in vfat. However, vfat is an older, less robust and error-resistant file system, and has limitations, amongst others with respect to the maximum file size it can store. Ubuntu, on the other hand, has different file systems. The ext4 system is the most used and is the file system created by a default installation.

Linux can read and write ntfs partitions flawlessly, unless other operating systems (I am looking at you, Apple). Thus, from this point of view, what you want can be achieved.

There is a major caveat, however. ntfs is a proprietary file system format. The ins and outs of the file system therefore are known only by the company that created the file system. While Ubuntu and GNU/Linux operating systems in general, can work with it, and even have basic tools to check the consistency of the file system, only the Windows file system checking tools (chkdsk at the command line) are fully capable of deeply investigating and repairing the file system. For this reason, any critical ntfs partition you have should be accessible by a Windows system.

You can't easily take out an internal disk to temporarily mount it to a Windows system to check. Thus, it is strongly discouraged to keep ntfs partitions around on internal drives where no Windows system is installed.

The advice, if you move away from Windows to Ubuntu, is therefore to reformat all existing partitions to a linux filesystem, typically ext4. This will erase all data, so you should move the data to an external disk, and make sure your backup is up to date, so data can be restored after the installation of the new operating system.

vanadium
  • 88,010
  • I am new to ubunto so just a quick question . Suppose ubuntu ran into some problem , would I be able to retain data in /home directory if I want to install windows/ubuntu again ? – Manohar Jan 12 '19 at 08:32
  • 2
    The bottom line is: if you value data, you always should have a backup of it. At that point, the question is not anymore relevant - there is always the backup, To your specific question: the data partition can always be preserved if it is on a separate partition than the operating system.However, to make it accessible by the new OS, you will need to convert the partition again to ntfs. – vanadium Jan 12 '19 at 08:37
  • thanks for the help . I will now be entering into ubuntu world – Manohar Jan 12 '19 at 08:51