Access home partition on another drive with fstab

Asked by Claude Chmielewski

I have my Ubuntu 14.04.1 on a drive by itself. My /home partition is on another drive. I want to edit fstab to access that /home partition when I boot. I have done this before but forgot what I did. It was pretty simple but I did not document what I did. I belong to a local Linux users group and these guys are wizards but maybe my problem isn't that important.

OK I've tried:
UUID=/media/claude/0be344fb-0290-4163-942d-b3ba8ec19e06/ ext4
UUID=/media/claude/0be344fb-0290-4163-942d-b3ba8ec19e06/home ext4
UUID=/dev/sda1/claude/0be344fb-0290-4163-942d-b3ba8ec19e06/home ext2
UUID=/dev/sda1/claude/0be344fb-0290-4163-942d-b3ba8ec19e06/home ext3
UUID=/dev/sda1/claude/0be344fb-0290-4163-942d-b3ba8ec19e06/home ext4

This is what I get. I wish I would have saved a document on how I did this. It was pretty easy but that was years ago.

(gedit:4604): Gtk-WARNING **: Calling Inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Manfred Hampl
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

What is the output of:

sudo blkid; lsb_release -a; uname -a

Thanks

Revision history for this message
Claude Chmielewski (claudeski) said :
#2

/dev/sda1: UUID="0be344fb-0290-4163-942d-b3ba8ec19e06" TYPE="ext4"
/dev/sda5: UUID="fa4123b3-9a3a-47db-aee1-5afe8535671f" TYPE="swap"
/dev/sdb: UUID="673cba8c-d2e0-41cf-bc0e-b431624c56ae" TYPE="ext4"
/dev/sdc1: UUID="4ffd86bf-3035-4f5a-bbac-be648eebcf6e" TYPE="ext4"
/dev/sdc5: UUID="4b2ecb08-cc97-434c-9246-a3f258b9c866" TYPE="swap"
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.1 LTS
Release: 14.04
Codename: trusty
Linux claude-MS-7680 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:12 UTC 2014 i686 i686 i686 GNU/Linux

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3

Ok and the output of:

cat /etc/fstab

Thanks

Revision history for this message
Claude Chmielewski (claudeski) said :
#4

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda1 during installation
UUID=4ffd86bf-3035-4f5a-bbac-be648eebcf6e / ext4 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
UUID=4b2ecb08-cc97-434c-9246-a3f258b9c866 none swap

0 0

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#5

Ok run:

sudo gedit /etc/fstab

And add:

UUID=0be344fb-0290-4163-942d-b3ba8ec19e06 /home ext4 defaults 0 2

Save the new file and reboot to test, the partition will mount to /home

The data currently in /home will still exist but not accessible due to the mount...

Revision history for this message
Claude Chmielewski (claudeski) said :
#6

I am responding from my laptop. This has been the biggest nightmare on Linux. Originally I was upgrading Ubuntu and the computer froze. It would not do anything after that. So I installed a new drive to boot from. I edited my fstab as shown above. That blew out my password. I am now reinstalling Ubuntu 14.04.1.

Revision history for this message
Claude Chmielewski (claudeski) said :
#7

I have reinstalled Ubuntu twice. The computer will not boot. After the main board screen I get a black screen. I disconnected the other two drives and still no boot. I am now reinstalling Ubuntu with only one drive connected.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#8

It didn't "blow out your password" at all. Your password is stored in /etc in an encrypted file and nothing to do with /home

You were unable to login because you needed to chown the /home/$USER to your own user so that it has full access. If you don't have full access it can cause you to be kicked back to the login page.

Also to undo the change, all you had to do was press CTRL + ALT + F1 and login there and comment out the line. Instead of all this you decided to take it on yourself to reinstall. ....

Think about it. ..

Revision history for this message
Claude Chmielewski (claudeski) said :
#9

Even though I have been using Linux since 1998 I don't know a whole lot of stuff that I should. When you think an upgrade should be seemless and something goes wrong it's difficult for me. This isn't the first time it's happened. This computer is fairly new so I can't blame that. I tried to install ver 11 on the original drive and got a black screen on boot. So since I really don't like having my /home partition on the boot drive I added another drive.

On to business: I have edited fstab and got this again:

(gedit:2183): Gtk-WARNING **: Calling Inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files
claude@claude-MS-7680:/etc$

I will reboot now

Revision history for this message
Manfred Hampl (m-hampl) said :
#10

That Gtk message is just an annoying warning that in most cases can safely be ignored.

Revision history for this message
Claude Chmielewski (claudeski) said :
#11

The reboot didn't work. Had go to a maintenance shell and vi fstab and delete the line. Is it possible the drive where my /home partition is that it has a non-operating OS and causing the problem?

Revision history for this message
Claude Chmielewski (claudeski) said :
#12

This is the new fstab file. Was I supposed to comment out any lines when I edited it?

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda1 during installation
UUID=fa784f2b-7090-418f-87ee-901ed960b5c8 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation

UUID=4b2ecb08-cc97-434c-9246-a3f258b9c866 none swap
sw 0 0

Revision history for this message
Manfred Hampl (m-hampl) said :
#13

There is an inconsistency in your UUIDs

In your printout of the blkid command on 2014-12-17 17:41:15 UTC there was no UUID fa784f2b-7090-418f-87ee-901ed960b5c8, but now this one is dedicated as root file system.
Have you reformatted the drives when reinstalling?

Which partition is now the root partition, and which one do you have for /home ?
What is now the output of

sudo blkid
sudo fdisk -l
mount

Revision history for this message
Claude Chmielewski (claudeski) said :
#14

Partly my bad. Forgot to plu in the other drives. With done it still doesn't work.
/dev/sda1: UUID="0be344fb-0290-4163-942d-b3ba8ec19e06" TYPE="ext4"
/dev/sda5: UUID="fa4123b3-9a3a-47db-aee1-5afe8535671f" TYPE="swap"
/dev/sdc1: UUID="fa784f2b-7090-418f-87ee-901ed960b5c8" TYPE="ext4"
/dev/sdc5: UUID="4b2ecb08-cc97-434c-9246-a3f258b9c866" TYPE="swap"
/dev/sdb: UUID="673cba8c-d2e0-41cf-bc0e-b431624c56ae" TYPE="ext4"
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.1 LTS
Release: 14.04
Codename: trusty
Linux claude-MS-7680 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:12 UTC 2014 i686 i686 i686 GNU/Linux

Disk /dev/sdc: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x0007a67c

   Device Boot Start End Blocks Id System
/dev/sdc1 * 2048 972756991 486377472 83 Linux
/dev/sdc2 972759038 976771071 2006017 5 Extended
Partition 2 does not start on physical sector boundary.
/dev/sdc5 972759040 976771071 2006016 82 Linux swap / Solaris

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/sdb doesn't contain a valid partition table

/dev/sdc1 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)
systemd on /sys/fs/cgroup/systemd type cgroup (rw,noexec,nosuid,nodev,none,name=systemd)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,user=claude)

The last reboot with the fstab edited I had to crtl alt F1. Login produced "No directory Logging with HOME=/

Revision history for this message
Claude Chmielewski (claudeski) said :
#15

I did not reformat anything. sdb is my backup drive.

Revision history for this message
Manfred Hampl (m-hampl) said :
#16

I assume, the fstab entry as suggested by actionparsnip

UUID=0be344fb-0290-4163-942d-b3ba8ec19e06 /home ext4 defaults 0 2

should still be correct.

I recommend you test mounting the device that you have designated as /home for testing to another directory first.
What is the output of the terminal commands

sudo mkdir /media/testdir
sudo mount /dev/sda1 /media/testdir
sudo ls -la /media/testdir
sudo umount /media/testdir
sudo rmdir /media/testdir

Revision history for this message
Claude Chmielewski (claudeski) said :
#17

I am posting what you want. But first it looks like I am having a problem with terminology. There was a time when I had a separate drive with a home partition. This time it happens that I have a home directory that was made by a previous OS install. Yesterday one of the MLUG boys put the clue in my head. So I copied all my data over to my backup drive and proceeded to make the sda1 drive a /home partition. So far I don't have permission to write to that drive. So I guess I have to establish permissions (don't know how yet), copy over the data and then edit my fstab to access it.

'sudo mkdir /media/testdir'
No result

'sudo mount /dev/sda1 /media/testdir'

No result

'sudo ls -la /media/testdir'

total 24
drwxr-xr-x 3 root root 4096 Dec 18 21:03 .
drwxr-xr-x 4 root root 4096 Dec 19 10:14 ..
drwx------ 2 root root 16384 Dec 18 21:03 lost+found

'sudo umount /media/testdir'

'sudo rmdir /media/testdir'

Make directory showed no results.

Revision history for this message
Claude Chmielewski (claudeski) said :
#18

I am trying to edit fsatb but it's not working.

claude@claude-MS-7680:~$ cd /media/claude
claude@claude-MS-7680:/media/claude$ ls -l
total 4
drwxr-xr-x 4 claude claude 4096 Dec 19 10:31 _home

claude@claude-MS-7680:/media/claude$ sudo blkid
[sudo] password for claude:
/dev/sda1: LABEL="/home" UUID="01d795cd-04dd-42cc-9506-5e53a249f571" TYPE="ext4"
/dev/sdb: UUID="673cba8c-d2e0-41cf-bc0e-b431624c56ae" TYPE="ext4"
/dev/sdc1: UUID="fa784f2b-7090-418f-87ee-901ed960b5c8" TYPE="ext4"
/dev/sdc5: UUID="4b2ecb08-cc97-434c-9246-a3f258b9c866" TYPE="swap"

Revision history for this message
Claude Chmielewski (claudeski) said :
#19

Whoops! fstab

Revision history for this message
Manfred Hampl (m-hampl) said :
#20

The output of the series of commands including

sudo mount /dev/sda1 /media/testdir
sudo ls -la /media/testdir

show that the file system on /dev/sda1 is empty.
Is this what you expect?

Revision history for this message
Claude Chmielewski (claudeski) said :
#21

claude@claude-MS-7680:~$ sudo mount /dev/sda1 /media/testdir
claude@claude-MS-7680:~$ sudo ls -la /media/testdir
total 72
drwxr-xr-x 11 claude claude 4096 Dec 21 07:53 .
drwxr-xr-x 4 root root 4096 Dec 21 17:37 ..
-rw------- 1 claude claude 36 Dec 19 18:09 .bash_history
drwx------ 10 claude claude 4096 Dec 19 18:07 .cache
drwx------ 3 claude claude 4096 Dec 19 18:09 .compiz
drwx------ 15 claude claude 4096 Dec 19 18:09 .config
drwx------ 3 root root 4096 Dec 19 18:07 .dbus
drwx------ 3 claude claude 4096 Dec 19 18:07 .gconf
drwx------ 2 root root 4096 Dec 19 18:07 .gvfs
drwxrwxr-x 3 claude claude 4096 Dec 18 12:33 Home
-rw------- 1 claude claude 350 Dec 19 18:06 .ICEauthority
drwx------ 3 claude claude 4096 Dec 19 18:06 .local
drwx------ 2 claude claude 16384 Dec 18 21:03 lost+found
-rw------- 1 claude claude 59 Dec 19 18:06 .Xauthority
-rw------- 1 claude claude 1487 Dec 19 18:09 .xsession-errors

As of yesterday this is where I am. /media/claude is /dev/sda1.

I can see everything that's on it. When I boot up I want to access that /home data instaed of the /home that was installed with the new OS.

claude@claude-MS-7680:~$ cd /media/claude
claude@claude-MS-7680:/media/claude$ ls -l
total 4
drwxr-xr-x 12 claude claude 4096 Dec 19 19:01 _home
claude@claude-MS-7680:/media/claude$ cd _home
claude@claude-MS-7680:/media/claude/_home$ ls -l
total 24
drwxrwxr-x 6 claude claude 4096 Dec 19 19:01 claude
drwxrwxr-x 3 claude claude 4096 Dec 18 12:33 Home
drwx------ 2 claude claude 16384 Dec 18 21:03 lost+found

claude@claude-MS-7680:/media/claude/_home$ cd Home

claude@claude-MS-7680:/media/claude/_home/Home$ ls -l
total 4
drwxrwxr-x 48 claude claude 4096 Dec 9 20:54 claude
claude@claude-MS-7680:/media/claude/_home/Home$

claude@claude-MS-7680:~$ sudo blkid
[sudo] password for claude:
/dev/sda1: LABEL="/home" UUID="01d795cd-04dd-42cc-9506-5e53a249f571" TYPE="ext4"
/dev/sdb: UUID="673cba8c-d2e0-41cf-bc0e-b431624c56ae" TYPE="ext4"
/dev/sdc1: UUID="fa784f2b-7090-418f-87ee-901ed960b5c8" TYPE="ext4"
/dev/sdc5: UUID="4b2ecb08-cc97-434c-9246-a3f258b9c866" TYPE="swap"

Revision history for this message
Manfred Hampl (m-hampl) said :
#22

What is the definition of your home directory?

What is the output of

grep claude /etc/passwd
echo $HOME
ls -l /media/claude/_home/Home/claude

Revision history for this message
Claude Chmielewski (claudeski) said :
#23

'grep claude /etc/passwd'
claude:x:1000:1000:claude,,,:/home/claude:/bin/bash

'echo $HOME'
/home/claude

claude@claude-MS-7680:/media/claude/_home/Home/claude$ ls -l
total 9142588
-rw-rw-r-- 1 claude claude 4680914944 Nov 1 2012 brasero.iso
-rw-rw-r-- 1 claude claude 148592 Jan 29 2013 brasero-session.log
drwxrwxr-x 3 claude claude 4096 Aug 17 2009 ccslinux
drwxrwxr-x 8 claude claude 4096 Oct 12 2009 cxoffice
drwxrwxr-x 2 claude claude 4096 Dec 2 12:31 Desktop
drwxrwxr-x 65 claude claude 4096 Dec 21 11:26 Documents
drwxrwxr-x 2 claude claude 4096 Jan 29 2013 Downloads
-rw-r--r-- 1 claude claude 179 Jan 28 2012 examples.desktop
drwxrwxr-x 2 claude claude 4096 Feb 4 2012 Music
drwxrwxr-x 7 claude claude 4096 Oct 29 2009 photos
drwxrwxrwx 80 claude claude 4096 Oct 22 11:59 Pictures
drwxrwxr-x 2 claude claude 4096 Jan 28 2012 Public
drwxrwxr-x 2 claude claude 4096 Jan 28 2012 Templates
drwxrwxr-x 2 claude claude 4096 Oct 31 2012 Ubuntu One
drwxrwxr-x 2 claude claude 4096 Jan 9 2014 Videos
-rw-rw-r-- 1 claude claude 12288 May 18 2012 VIDEO_TS.BUP
-rw-rw-r-- 1 claude claude 12288 May 18 2012 VIDEO_TS.IFO
-rw-rw-r-- 1 claude claude 249856 May 18 2012 VIDEO_TS.VOB
-rw-rw-r-- 1 claude claude 96256 May 18 2012 VTS_01_0.BUP
-rw-rw-r-- 1 claude claude 96256 May 18 2012 VTS_01_0.IFO
-rw-rw-r-- 1 claude claude 397312 May 18 2012 VTS_01_0.VOB
-rw-rw-r-- 1 claude claude 1073739776 May 18 2012 VTS_01_1.VOB
-rw-rw-r-- 1 claude claude 1073739776 May 18 2012 VTS_01_2.VOB
-rw-rw-r-- 1 claude claude 1073739776 May 18 2012 VTS_01_3.VOB
-rw-rw-r-- 1 claude claude 1073739776 May 18 2012 VTS_01_4.VOB
-rw-rw-r-- 1 claude claude 385021952 May 18 2012 VTS_01_5.VOB

Revision history for this message
Manfred Hampl (m-hampl) said :
#24

The only open question for me now is why the commands

sudo mount /dev/sda1 /media/testdir
sudo ls -la /media/testdir

produced different output on comments #17 and 21

Can you explain?

Revision history for this message
Claude Chmielewski (claudeski) said :
#25

Because I reformatted the drive and made it a home partition and copied the complete data over.

Revision history for this message
Best Manfred Hampl (m-hampl) said :
#26

Ok, understood.

Apparently you have prepared /dev/sda1 in a way that it is not the /home directory tree, but only your personal home directory.

Editing /etc/fstab and adding the line

UUID=01d795cd-04dd-42cc-9506-5e53a249f571 /home/claude ext4 defaults 0 2

should be the right change for your situation.

Modify fstab and reboot. In case it does not work, reboot in recovery mode - command prompt and use the nano editor to comment out that line again and reboot again.

Revision history for this message
Claude Chmielewski (claudeski) said :
#27

Thank you very much. Now to solve my other problems.

Revision history for this message
Claude Chmielewski (claudeski) said :
#28

Thanks Manfred Hampl, that solved my question.