2

I recently got a new W8 computer and followed this tutorial to get Ubuntu installed in dual boot. This is what my file system looks like:

Device        Directory      Total
/dev/sda6     /               45GBiB
/dev/sda2     /boot/efi       356MiB
/dev/sda7     /HOME           874.3GiB

Now, I was going about my data science stuff and downloaded a 12GB file, and un-zipped it. I start getting errors saying that I do not have enough memory. I know I have ~1TB allocated to Linux. All I can tell is that I was working in /Home/myusername assuming that that's where most of my space was allocated, but it seems as though ~800GB are in /HOME. Since I'm new to Linux I'm a little confused. Any ideas on how to go about this? Should I just start using /HOME or is there a proper way to reallocate space?

1
  • 1
    - /home should be in lowercase, not in capitals. - do a df -h and check the free space.
    – Rinzwind
    Mar 31, 2014 at 17:49

1 Answer 1

1

The default Linux file system is case sensitive. You have defined a mountpoint at /HOME when instead, you should have used /home. Therefore, the /HOME is simply not used, it is not your actual home directory, that is in /home/username which is completely separate from /HOME.

To fix this and use the 874G partition you have created as your actual home directory (in the Linux world, your home dir is referred to as $HOME (note the $) or ~/), you will need to follow these steps:

  1. Create your home directory on /HOME:

    sudo mkdir "/HOME/$USER"
    sudo chown username "/HOME/$USER"
    
  2. Copy everything from your current $HOME to this new directory.

    mv ~/* ~/.* "/HOME/$USER"
    
  3. Tell the system to mount the partition of /HOME in the right place, /home. For this, you will need to edit /etc/fstab:

    sudo gedit /etc/fstab
    

    That will bring up an editor window, you need to find the line that mounts /HOME, it will look something like this:

    UUID=123-ABC    /HOME   ext4    rw,errors=remount-ro    0   0
    

    Change /HOME to /home, leave everything else as it is.

  4. Remove your home dir and reboot

    sudo rmdir "/home/$USER"
    sudo reboot
    
16
  • please user $USER instead of username ;-) the system will tranform it to the current user and commands then actually work.
    – Rinzwind
    Mar 31, 2014 at 17:59
  • And that copy command will not work either, use find or rsync
    – Panther
    Mar 31, 2014 at 18:07
  • @bodhi.zazen why not? Changed to mv to simplify but the cp would get everything. Note that I'm using -r and also specifying ~/.*.
    – terdon
    Mar 31, 2014 at 18:08
  • 2
    I am a bit old-schooled, but I prefer (as root) tar cf - . | (cd /dest/dir; tar xvpf -) for massive copies. It will maintain (possible) different-owned files, mod times, and do the correct thing even for special files. Probably overkill in this case, but...
    – Rmano
    Mar 31, 2014 at 19:18
  • 1
    @Rmano yes, that is better (+1) but given that this is a new install and an inexperienced user, I tried to keep things simple.
    – terdon
    Mar 31, 2014 at 19:21

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.