0

I recently installed dual boot Windows 10 and Ubuntu 20.04 on a new machine. I followed a guide which suggested giving /home a 10GB partition and throwing the rest in /. I started putting all my documents and media files in /home and quickly ran out of space. In hindsight, I would not have given myself so little space on /home, but I am unwilling to reformat and start again.

A simple solution is to symlink specific subfolders /home/username/bigstuff out to a folder on the big partition, say /media/extra-space/username/bigstuff. A detailed way of doing this is outlined by Paul's answer in this question. This works fine, except the permissions seem to be such that I cannot do anything in /home/username/bigstuff without a sudo.

I have three questions, with the last one being the most important for me:

  1. Is this solution appropriate, or would it make experienced users weep? Should I be using a different directory, perhaps simply /extra-space/username/bigstuff ?
  2. I am misunderstanding something basic: if /home is a subdirectory of /, how can it be on a separate partition? (This is what got me in the first place.) (answered)
  3. How can I avoid having to write sudo every time I want to execute a command in /home/username/bigstuff (which is really on /media/extra-space/username/bigstuff)? I've tried changing the permissions on /media/extra-space/username but was not successful.

Thanks in advance.

EDIT in response to comments:

The output of stat --format=%m /media/extra-space/username/bigstuff is /. The output of stat --file-system --format=%T /media/extra-space/username/bigstuff is ext2/ext3. I'm not sure how to identify the relevant line of output from mount. The output of ls -ld /media/extra/username/bigstuff is

drwxr-xr-x 4 root root 4096 Feb 13 16:26 /media/extra/username/bigstuff

If it helps, in System Monitor, I see the following File Systems:

Device      Directory  Type 
/dev/sdb7   /          ext4
/dev/sdb1   /boot/efi  vfat
/dev/sdb5   /home      ext4

To be clear, I get a permission denied for mkdir when in ~/username/bigstuff, but it does seem correctly symlinked because after doing sudo mkdir test, /media/extra/username/bigstuff/test appears.

9
  • @KamilMaciorowski Thanks for the links. The first two links address the first two questions, while the third discusses permissions for mounts rather than symlinks. It seems mount.ntfs-3g may still be the utility of choice. Do I understand correctly that I should read carefully read the documentation of this driver and attempt to change permissions on my symlink? Thanks again.
    – snar
    Feb 13, 2021 at 22:10
  • What is the filesystem that holds /media/extra-space/username/bigstuff? How do you mount it? With what options? For a start please post the relevant line from the output of mount. Feb 14, 2021 at 0:29
  • @KamilMaciorowski I don't want to mount it, /media is simply on the same partition as my installation of Ubuntu is on. /home/username/bigstuff is symlinked to /media/extra-space/username/bigstuff, but when I try to execute commands such as mkdir within .../bigstuff, I need to prefix it with sudo. I want to avoid that. Using chown didn't work. I'm sure there's a simple way of adding permissions, I just don't know how.
    – snar
    Feb 14, 2021 at 0:42
  • You already have mounted some filesystem(s). What is the output of stat --format=%m /media/extra-space/username/bigstuff? What is the output of stat --file-system --format=%T /media/extra-space/username/bigstuff? What is the relevant line from the output of mount? Feb 14, 2021 at 0:48
  • What is the output of ls -ld /media/extra-space/username/bigstuff? Feb 14, 2021 at 0:54

1 Answer 1

0

To recap, I:

  • Created a directory extra/username/bigstuff in /media, which is on the device /dev/sdb7
  • Ran ln -s /media/extra/username/bigstuff /home/username/bigstuff
  • After Kamil pointed out that bigstuff is owned by root, I ran sudo -R chown username:username bigstuff. I also ran sudo chmod +w bigstuff. Now, ls -ld /media/extra/username/bigstuff gives drwxrwxr-x 3 username username 4096 Feb 13 16:19 /media/extra/username/bigstuff

Then I started poking more and got confused because I could create directories and files in subdirectories of .../bigstuff, but not in /bigstuff. I also saw that the owner name/group of /media/extra/username was still root:root. I sudo chown'ed that and that resolved my issues (can now create directories in .../bigstuff).

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.