0

I am a beginner to Ubuntu,I has been installed Ubuntu for a few days.Today it noticed me it doesn't has enough room,and then I execute the command.

mount -t ext4 /dev/sda6 /home

But unfortunately,when I restart my computer,I found that after I login with my username and password,I only can see my wallpaper in my desktop,and other things are disappeared. There are two additional messages:

1.I can login with the role of guest

2.I have ever backupd with the system's tool,and the backups are in the directory named deja-dup.But I don’t know how to use them ,they are all gpg files.

I am so nervous ,so come here to ask for help.Thank you very much.

The result of command mount as follows:

/dev/sda1 on / type ext4 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/cgroup type tmpfs (rw)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
none on /run/user type tmpfs (rw,noexec,nosuid,nodev,size=104857600,mode=0755)
none on /sys/fs/pstore type pstore (rw)
overflow on /tmp type tmpfs (rw,size=1048576,mode=1777)
systemd on /sys/fs/cgroup/systemd type cgroup (rw,noexec,nosuid,nodev,none,name=systemd)
gvfsd-fuse on /run/user/112/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,user=lightdm)
3
  • Could you run the command mount and add the result to your question please?
    – Mark Smith
    Apr 2, 2016 at 10:05
  • I have added the result to my question.Maybe some of my operation may change something.
    – Peiqin
    Apr 2, 2016 at 10:31
  • Where exactly is there not enough space? Have you tried deleting something? The df -h command might be more useful with space problems. Apr 2, 2016 at 11:19

1 Answer 1

0

In short, you manually mounted your /dev/sda6 (whatever it is). But at shut down, it is unmounted and you'd have to manually mount again after restarting. You can make the mount permanent through /etc/fstab.

Assuming that your /dev/sda6 is a partition of your hard drive and that it has an ext4 filesystem on it, you can use these steps to permanently put your home directory on it. Make sure to also check out https://help.ubuntu.com/community/Partitioning/Home/Moving. I'm using the command line for all steps.

  1. Find the UUID of /dev/sda6:

    sudo blkid
    

Why UUID? In Ubuntu, it is now best practice to use the device's UUID instead of it's name, because the UUID is truly unique and won't change.

  1. Make a backup copy of the file /etc/fstab:

    sudo cp /etc/fstab /etc/fstab.ori
    

You can compare the copy and the original to make sure you have a correct backup:

    sudo cmp /etc/fstab /etc/fstab.ori # should show no output
  1. Open /etc/fstab in an editor. I'll use nano. Use Ctrl+O (the letter, not the number) to save changes and use Ctrl+X to exit.

    sudo nano /etc/fstab
    

Add the following line to the bottom. Replace [UUID] with the UUID of your device (copy the string with the dashes, but without the quotes).

    UUID=[UUID]    /media/home    ext4    defaults    0    2

Save and exit. 4. Create the mount point and then remount everything that is in /etc/fstab:

    sudo mkdir /media/home
    sudo mount -a

This will mount your /dev/sda6 device on /media/home. 5. We'll now copy the contents of the current home directory to /dev/sda6. Using rsync with the -avz flags makes sure that metadata like file ownership and times are copied as well. The diff command checks if all files copied correctly, it should show difference in .bash_history only.

    sudo rsync -avz /home/ /media/home/
    sudo diff -r /home /media/home
  1. Change the mount point of your /dev/sda6 device to /home in /etc/fstab (open with sudo nano):

    UUID=[UUID]    /home    ext4    defaults    0    2
    
  2. We'll now move the current home directory away and create a new, empty home directory. After remounting your /dev/sda6 device is mounted on /home and also automatically mounted at boot. Everything in /home is now on your /dev/sda6 device.

    sudo mv /home /old_home
    sudo mkdir /home
    sudo mount -a
    

After you have made sure everything is in place you can remove the old home with:

    sudo rm -rf /old_home

Done!

1
  • Because when using numbered lists, you need to use 8 spaces! (See my edits ;-) En welkom aan boord trouwens!
    – Fabby
    Apr 3, 2016 at 23:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .