9

I am a new user in Ubuntu, with a windows background. I have a 500 GB HDD on my old laptop and I made a partition sized around 50 GB for the system use, and another one ~ 410 GB for my personal use. The mount point for the 410 GB one is set to /home, because I could not install the system without a mount point and I read that /home is somewhat of a default.

However, when I install the system the only partition I see in nautilus is this one:

Here

But when I open GParted:

Here

Am I doing something wrong? Is the 410 GB one not used, though it is listed in GParted, and how can I use it?

I wont exclude the possibility of me lacking knowledge because this is my first time using Ubuntu. Maybe it's here and it is active, but I don't know how to access it and store my files on it?

Thanks and sorry!

  • 1
    open terminal and type df -h. paste back the output. – niry Dec 3 '18 at 14:38
  • Your system looks correct to me: Nautilus, the file manager, shows only the root partition. I think what you are looking for can be found by right clicking on the word Home in the file manager, and choosing Properties – Charles Green Dec 24 '18 at 16:45
16

With your settings, I wouldn't expect that you find your "Home" in "Other locations". Your home is mounted when your system boots. You can access it straight via the "Home" (and Document, Music, Pictures...) link in Nautilus, the file explorer. It is not an "Other location", it's part or your File System, even if installed on two different partitions.

  • So how do I create another partition that I can view from "other locations"? What I want to do is have two partitions - one for my system(I have it) and the one with the remaining GB for my personal use. I guess the mount point does not have to be /home , right? – – john doe Dec 3 '18 at 17:25
  • 2
    @johndoe I may be misunderstanding the question, but from what I see in the second screen, it looks like it's already what you want: the big partition (/dev/sda2) is there, formatted, and mounted on /home. Unless you went out of your way to change your home folder location, it should be /home/<your username>, so on the big partition, with all your Music/Pictures/etc... folders. Unlike Windows where separate partitions are generally presented as kinda distinct folder hierarchy, this is not how it is usually done on Linux where mounted partitions appear as simple folders. – Reyssor Dec 3 '18 at 19:13
  • 1
    I agree with @Reyssor, to me you have already exactly what you describe :) – FloT Dec 3 '18 at 20:35
  • 2
    @johndoe You're trying to make this more complicated than it actually is. In your first screenshot the folders Desktop, Documents, Downloads, etc. are stored as /home/johndoe/Desktop, /home/johndoe/Documents, etc. on your 410GB partition. What you're asking for is exactly what you already have. – pconley Dec 4 '18 at 1:37
  • 1
    So how do I create another partition that I can view from "other locations"? This one and your original question are two different. For this, you had to do it when you were installing same as you've created /home, you can do for remaining like 50 GB NTFS partition but after installation, you can try this. – d a i s y Dec 4 '18 at 10:00
11

Coming from a Windows background, you probably wouldn't know this, but Ubuntu (or any Linux system) uses partitions in a different way than Windows does, which is why you're not seeing both the partitions you created.

As you know, in Windows, when you mount a partition it shows up as a drive (C:, D:, or so on), and all the drives are listed under My Computer. Each drive has its own entirely separate hierarchy of files. But Linux uses a different model. In Linux, as far as the operating system is concerned, there is only one hierarchy, which is more or less effectively stored in the kernel's memory. Partitions get mounted by attaching them at certain points in this hierarchy, namely mount points, and when that happens, the contents of the newly mounted partition appear as directories and files under that mount point.

You can think of it as though partitions in Linux provide backing storage for parts of the filesystem.

Here's an example that, while not being 100% accurate, should help you understand how it works. Suppose your two partitions have these contents:

Partition 1:
  bin/
  home/
  usr/
Partition 2:
  larry/
  moe/
  curly/

When the Linux kernel starts up, you can imagine that it starts with an empty "mental model" of the filesystem. ("In the beginning, there was /.")

/

Then it mounts a partition at the mount point /; let's say that is partition 1. After mounting, the filesystem has these three directories:

/bin/
/home/
/usr/

Then it mounts partition 2 at the mount point /home. After that, the filesystem has these six directories:

/bin/
/home/
/home/larry/
/home/moe/
/home/curly/
/usr/

The net effect of this is that everything under /home/curly is on partition 2, while everything else under / is on partition 1. So, when asked to access a file like, say, /home/curly/maharajah.txt, the kernel will note that this file is under partition 2's mount point /home and there are no other mount points "on the way" from /home to the path of the file, so it will put the file at curly/maharajah.txt on partition 2. A different file like /bin/ow, would be placed on partition 1 because it is under partition 1's mount point but not under any other partition's mount point.

But all of this managing mount points is invisible to you, as the user of the computer. In normal day-to-day usage you don't typically care which directories are on which partitions; when you make a file, all you think about is the path /home/curly/maharajah.txt and you let the kernel worry about which partition to actually put that file on. So, unlike in Windows, partitions are meant to be invisible during normal use, and you work with the illusion that there is only one big filesystem that contains everything on the system. Some file managers, like Nautilus apparently, help promote that illusion by not even showing you what partitions are mounted.

What this means for your specific situation is that you (probably) already have things set up the way you want. Your 50 GB partition is mounted on /, and your 410 GB partition is mounted on /home, and that means anything you create under /home will be placed on the 410 GB partition while everything else on the system will be placed on the 50 GB partition. (Well actually there are other "imaginary partitions" created by various Linux system components, but forget about that for now.) It's just that Nautilus is not making it very clear that both partitions are being used, and in fact being kind of misleading by showing the space usage for only partition 1 in the "other locations" screen.

  • Nice explanation. – Joe Dec 7 '18 at 18:24
7

GParted generally shows the actual mount point of the partition. If a partition is like some external storage device or which has nothing to do with the Ubuntu like in my case I have 3 partitions which doesn't include any system file of Ubuntu, it is mounted in /media/ directory which generally creates a mount point there like I have mount point like /media/kulfy/DE14D51314D4EF8F for my one of the partition. It was created automatically. And this partitions/storage devices can be accessed from Other Locations as well.

Your GParted shows that the mount point for /dev/sda2 is /home thus the partition is already mounted and /home as the mount point. So, there is no entry in Other Locations since it performs as an important part of the main installation. You can also run findmnt /dev/sda2 for more info.

  • Actually ~ is synopsis to /home/<username> and it is possible to have several user's home directories under /home... – pa4080 Dec 3 '18 at 15:05
  • @pa4080 Yeah. I completely forgot that. I usually work on a single user PC that's why. Thank you for notifying. Edited the post :-) – Kulfy Dec 3 '18 at 15:23
  • @Kulfy So how do I create another partition that I can view from "other locations"? What I want to do is have two partitions - one for my system(I have it) and the one with the remaining GB for my personal use. I guess the mount point does not have to be /home , right? – john doe Dec 3 '18 at 17:24
  • @Kulfy if you're going to play games with system partitions, it's much safer to boot from a live CD/flash than to try to do it on a running system. A new user should steer clear of anything like this until they know more. It's pretty easy to make an unbootable system or do other significant dhamage when working at this level. – Joe Dec 7 '18 at 18:41
6

Data partition

You can create another partition that you can view from "other locations" with gparted, when booted from another drive, for example an Ubuntu live/install USB pendrive.

Many people have a data partition for personal files (documents, pictures, video clips, music ...).

  • Start by backing up at least all the files, that you cannot afford to lose.

  • Unmount and shrink an existing partition, and create the data partition in the drive space, that became unallocated after shrinking.

  • This partition can have an NTFS file system and be shared with Windows, if there is dual boot. Otherwise, if only Linux, I would suggest an ext4 file system.

  • In both cases it is a good idea to have a line in the file /etc/fstab in order to mount the data partition automatically. Create a mountpoint in /media, for example /media/data and point to its UUID in /etc/fstab. This line can be at (or near) the end of the file.

    UUID=862210fd-a6fd-4fe3-913c-e18e1448ef36 /media/data    ext4    defaults 0       2
    

    Use your own UUID for the data partition, which you find via

    sudo blkid
    

    After next boot (or reboot), it will be mounted and available.

  • Make the data partition available without elevated permissions for user and group, but not for others.

    • Use chown and chmod if there is a linux ext4 file system. When mounted: run

      sudo chmod -R o-rwx /media/data/
      sudo chown -R "$USER" /media/tester/data
      

      It is straightforward to modify the ownership and permissions afterwards for an ext4 partition.

    • Add mount options in /etc/fstab if there is an NTFS file system, after default separated with commas, , for example like so:

      UUID=27BB443011BACEB5   /media/data ntfs  defaults,rw,nosuid,nodev,relatime,user,uid=1000,dmask=007,fmask=117,exec  0  2
      

    The ownership and permissions of an NTFS partition are set when mounted, and cannot be changed with chown and chmod. But you can unmount and mount again with other settings.

  • It is not necessary but may help to set the label data on this partition,

    sudo tune2fs -L data /dev/sdxn
    

    where /dev/sdxn is the device specification as seen by sudo blkid; Replace x with the device letter and n with the partition number of your real case.


One advantage with a data partition is that the system partition(s) will be smaller. It will be possible to backup the personal data and the system separately, which is convenient.

  • Thanks for the help! I am not quite sure how to follow the fourth step. Where do I add the line /etc/fstab that you mentioned? Is it somewhere while creating the partition using GParted? Do I first create a partition in a mounpoint named "media/data", restart the computer and use the terminal to do things with /etc/fstab? Sorry, I started just today with Linux and I don't know much stuff about it – john doe Dec 3 '18 at 18:11
  • 1
    @johndoe, /etc/fstab is a file, a configuration file, that already exists. You edit it with a text editor and use sudo to get elevated permissions: sudo nano /etc/fstab. It can be a good idea to make a backup before editing: sudo cp -p /etc/fstab /etc/fstab.bak. – sudodus Dec 3 '18 at 18:16
  • @johndoe, The line for the data partition can be anywhere in /etc/fstab. I would put it at the end (as a last line) and be sure to press Enter at the end of the line, so that it ends with a 'line feed'. – sudodus Dec 3 '18 at 18:24
  • @sudodus The order of fstab-lines is relevant as you can't mount anything under /media/data if you don't mount / before. Also chown should be used to make the partition accessible for non-root-user. – mook765 Dec 3 '18 at 21:00
  • 1
    This is the way to do it, but it's really not advised for a beginner to be changing partitions around - unless they're working on a disposable installation that they can just reinstall from scratch if they break it. The OP is just learning what a Partition is and how it is used in the Linux world. – Joe Dec 7 '18 at 18:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.