LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices

Reply
 
Search this Thread
Old 08-26-2010, 08:06 AM   #1
Daravon
Member
 
Registered: Mar 2006
Posts: 166

Rep: Reputation: 15
Cannot mount unencrypted directory to encrypted home directory with fstab?


I have Ubuntu Karmic. I chose to install with an encrypted home directory.

Recently I got a warning that I only had 2GB of drive space left. This is mostly because of my videos. So I went and bought a new hard drive and partitioned it and made 1 ext4 partition and copied my videos all to the new hard drive.

I added a line in my fstab to mount the new hard drive to ~/videos, but when I reboot the computer, there is a screen saying something like "error mounting /home/me/videos, press S to skip or something else to reboot".

If I press S to skip, then when my system comes up there is a video directory but it's empty because my other hard drive didn't get mounted. I can run sudo mount /dev/sdb video/ and it will mount fine and I can see all my videos, so why can't fstab mount it? Does this have something to do with my encrypted home directory?
 
Old 08-26-2010, 12:45 PM   #2
tredegar
Guru
 
Registered: May 2003
Location: London, UK
Distribution: Ubuntu 10.04, mostly
Posts: 6,007

Rep: Reputation: 366Reputation: 366Reputation: 366Reputation: 366
Quote:
Does this have something to do with my encrypted home directory?
I am guessing that your home directory doesn't get unencrypted until you login.
So fstab can't mount the drive as the mountpoint does not exist because it has not been unencrypted yet.

You could mount the drive somewhere else eg /videos because that mountpoint will exist when fstab is doing its thing, and then make a link to it from your home directory.
 
1 members found this post helpful.
Old 08-26-2010, 12:59 PM   #3
Daravon
Member
 
Registered: Mar 2006
Posts: 166

Original Poster
Rep: Reputation: 15
So it DOES have to do with my encryption. LAME! I knew that was bound to complicate something. I really wanted to be able to mount the new hard drive to /videos because I have a HTPC that shares that directory and scripts that reference it and everything. I was going to have fstab mount it to ~/videos and everything would be seamless. If I had LVM I could just add this HDD to the volume, but I don't know if you can LVM with encryption either...

Plus it's going to be more annoying than a thousand suns to not be able to see any of my videos from my home directory. I rip and encode DVDs and everything, and having to use a /videos will be so lame. Is there any way to put the mount command in a script that runs after I log in at least?

Last edited by Daravon; 08-26-2010 at 01:02 PM.
 
Old 08-26-2010, 04:46 PM   #4
tredegar
Guru
 
Registered: May 2003
Location: London, UK
Distribution: Ubuntu 10.04, mostly
Posts: 6,007

Rep: Reputation: 366Reputation: 366Reputation: 366Reputation: 366
Quote:
So it DOES have to do with my encryption. LAME!
Quote:
I rip and encode DVDs and everything, and having to use a /videos will be so lame.
Please stop ranting about how "lame" you see it as.

The answer is in my previous post: Mount the drive somewhere that is not encrypted, then make a link from your (encrypted) home directory to the (valid) mountpoint.

Problem solved.

If you don't know how to do that, or can't work it out for yourself, then please post here again
 
1 members found this post helpful.
Old 08-26-2010, 05:14 PM   #5
tommcd
Senior Member
 
Registered: Jun 2006
Location: Philadelphia PA USA
Distribution: Lubuntu, Slackware
Posts: 2,229

Rep: Reputation: 286Reputation: 286Reputation: 286
Quote:
Originally Posted by Daravon View Post
Plus it's going to be more annoying than a thousand suns to not be able to see any of my videos from my home directory. I rip and encode DVDs and everything, and having to use a /videos will be so lame.
I have all my data including music and videos in my /data directory on a second hard drive. I can access it all just fine. So, just change the mount point to /videos, or /media/videos if you prefer. As Tredgear said, you can make a symlink to your home directory:
Code:
cd ~
ln -s /media/videos .
Note the period "." at the end of that command. This will create a videos link in your home directory you can click on to access the videos.
 
1 members found this post helpful.
Old 08-27-2010, 02:37 PM   #6
Daravon
Member
 
Registered: Mar 2006
Posts: 166

Original Poster
Rep: Reputation: 15
Quote:
The answer is in my previous post: Mount the drive somewhere that is not encrypted, then make a link from your (encrypted) home directory to the (valid) mountpoint.
Wow! That's a great idea. I think that would work-around my problem perfectly. I shall implement this workaround hastily upon my arrival at home from work, and live happily ever after for great justice.
 
Old 08-27-2010, 03:52 PM   #7
tredegar
Guru
 
Registered: May 2003
Location: London, UK
Distribution: Ubuntu 10.04, mostly
Posts: 6,007

Rep: Reputation: 366Reputation: 366Reputation: 366Reputation: 366
Quote:
I think that would work-around my problem perfectly.
It's not really a "work-around": it is how linux is supposed to work. You can mount anything anywhere, and then beautify it with links, so it looks and works the way you'd like it to.

Please let us know how you get on....
 
Old 08-27-2010, 05:30 PM   #8
Daravon
Member
 
Registered: Mar 2006
Posts: 166

Original Poster
Rep: Reputation: 15
Not well at all! Now I can't mount the directory, even by hand. It does this no matter where I try to mount it. And putting it in my fstab doesn't work either, probably for the same reason. I googled the error message, and lots of people said it was caused by evms, but it doesn't even look like I have any evms package installed, and there are no evms configs in /etc. I'm really stumped.

Code:
chaz@brutus:~$ sudo fdisk -l

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x2d3b2d3b

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1      121601   976760001   83  Linux

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0009b08c

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        1305    10482381   82  Linux swap / Solaris
/dev/sdb2   *        1306        2610    10482412+  83  Linux
/dev/sdb3            2611        3915    10482412+  83  Linux
/dev/sdb4            3916      121601   945312795   83  Linux
chaz@brutus:~$ umount /dev/sda1
umount: /dev/sda1 is not mounted (according to mtab)
chaz@brutus:~$ lsof video/
chaz@brutus:~$ 
chaz@brutus:~$ sudo mount /dev/sda1 video/
mount: /dev/sda1 already mounted or video/ busy
chaz@brutus:~$ 
chaz@brutus:~$ sudo apt-get remove evms
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Couldn't find package evms
chaz@brutus:~$ ls /etc/ | grep evms
chaz@brutus:~$
 
Old 08-27-2010, 06:21 PM   #9
Kenny_Strawn
Senior Member
 
Registered: Feb 2010
Location: /usa/ca/orange_county/lake_forest
Distribution: ArchBang, Google Android 2.1 + Motoblur (on Motortola Flipside), Google Chrome OS (on Cr-48)
Posts: 1,791
Blog Entries: 62

Rep: Reputation: 54
I see your problem:

First of all/ there is no directory ~/video. It's ~/Videos, with a capital V. Try mounting with a capital V and see if that does it.

Code:
sudo mount -t ext4 /dev/sda1 Videos/
 
Old 08-27-2010, 07:10 PM   #10
Daravon
Member
 
Registered: Mar 2006
Posts: 166

Original Poster
Rep: Reputation: 15
Quote:
First of all/ there is no directory ~/video. It's ~/Videos, with a capital V
Orly?

On my system there's no ~/Videos. There is a directory ~/video. I created it. I appreciate the idea but I get the mount error no matter where I attempt to mount /dev/sda1...even if I create a new directory and try to mount it there.
 
Old 08-27-2010, 08:15 PM   #11
tommcd
Senior Member
 
Registered: Jun 2006
Location: Philadelphia PA USA
Distribution: Lubuntu, Slackware
Posts: 2,229

Rep: Reputation: 286Reputation: 286Reputation: 286
Post the output of this command:
Code:
sudo mount -t auto /dev/sda1 /mnt
You can replace "auto" with the file system of /dev/sda1 (e.g., ext3 or ext4) if you wish.
This of course assumes that you currently have nothing mounted in /mnt. If you do, then just create a new directory under /mnt or /media or where ever.
 
Old 08-28-2010, 07:06 AM   #12
Daravon
Member
 
Registered: Mar 2006
Posts: 166

Original Poster
Rep: Reputation: 15
Code:
chaz@brutus:/$ cd mnt/
chaz@brutus:/mnt$ ls
chaz@brutus:/mnt$ cd ..
chaz@brutus:/$ ls
bin    dev   initrd.img      lib32	 media	proc  selinux  tmp  vmlinuz
boot   etc   initrd.img.old  lib64	 mnt	root  srv      usr  vmlinuz.old
cdrom  home  lib	     lost+found  opt	sbin  sys      var
chaz@brutus:/$ sudo mount -t auto /dev/sda1 /mnt
[sudo] password for chaz: 
mount: /dev/sda1 already mounted or /mnt busy
chaz@brutus:/$
Does it matter that I'm doing this with ssh? I never mattered before.
 
Old 08-28-2010, 07:45 AM   #13
tredegar
Guru
 
Registered: May 2003
Location: London, UK
Distribution: Ubuntu 10.04, mostly
Posts: 6,007

Rep: Reputation: 366Reputation: 366Reputation: 366Reputation: 366
Quote:
mount: /dev/sda1 already mounted or /mnt busy
Maybe it has been "auto-mounted" somewhere?
What is the output of the following commands please:

Code:
mount

ls -l /home <---- That's "minus ell" not "minus one"
And please tell us what filesystem /dev/sda1 was formatted with.

Then, I think we'll be able to give you the exact commands you need.
 
Old 08-28-2010, 01:18 PM   #14
Daravon
Member
 
Registered: Mar 2006
Posts: 166

Original Poster
Rep: Reputation: 15
This one really has me stumped. /dev/sda1 is formatted ext4. I have a couple files on it, and I have mounted it in the past on this system. I have no idea why, but now it will not mount anywhere. The only thing I can think is that when I added it to my fstab, to try to have it auto-mount, then some program or daemon saw it and put it in a config somewhere and now that's why it won't mount. But I have no idea what that would be.

Code:
chaz@brutus:~$ mount
/dev/sdb2 on / type ext3 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
none on /sys type sysfs (rw,noexec,nosuid,nodev)
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)
none on /dev type devtmpfs (rw,mode=0755)
none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
none on /dev/shm type tmpfs (rw,nosuid,nodev)
none on /var/run type tmpfs (rw,nosuid,mode=0755)
none on /var/lock type tmpfs (rw,noexec,nosuid,nodev)
none on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
/dev/sdb4 on /home type ext4 (rw)
nfsd on /proc/fs/nfsd type nfsd (rw)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
/home/chaz/.Private on /home/chaz type ecryptfs (ecryptfs_sig=24bb171294c41f37,ecryptfs_fnek_sig=0ae98bbd77893c06,ecryptfs_cipher=aes,ecryptfs_key_bytes=16)
gvfs-fuse-daemon on /home/jami/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=jami)
/dev/sr0 on /media/FliptCD type iso9660 (ro,nosuid,nodev,uhelper=udisks,uid=1001,gid=1001,iocharset=utf8,mode=0400,dmode=0500)
chaz@brutus:~$ ls -l /home
total 56
drwxr-xr-x 99 chaz chaz 32768 2010-08-27 17:19 chaz
drwxr-xr-x 75 jami jami  4096 2010-08-27 19:14 jami
drwx------  2 root root 16384 2010-07-05 15:45 lost+found
chaz@brutus:~$
Code:
chaz@brutus:~$ sudo fdisk -l
[sudo] password for chaz: 

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x2d3b2d3b

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1      121601   976760001   83  Linux

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0009b08c

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        1305    10482381   82  Linux swap / Solaris
/dev/sdb2   *        1306        2610    10482412+  83  Linux
/dev/sdb3            2611        3915    10482412+  83  Linux
/dev/sdb4            3916      121601   945312795   83  Linux
chaz@brutus:~$
Code:
chaz@brutus:~$ mkdir wtf
chaz@brutus:~$ ls
breakin    documents	keyshit   miscpics	 music		 pictures      video	  x264
codecs	   dvdrip-data	live	  mnt		 #newfile1.lyx#  pulse-backup  vidz
court.pdf  emulation	mems	  montana stuff  omicronstuffz	 sketchbook    workspace
desktop    jami		miscdocs  mplayer	 pics.tar	 vboxshare     wtf
chaz@brutus:~$ sudo mount /dev/sda1 wtf/
mount: /dev/sda1 already mounted or wtf/ busy
chaz@brutus:~$ umount /dev/sda1
umount: /dev/sda1 is not mounted (according to mtab)
 
Old 08-29-2010, 03:22 AM   #15
tredegar
Guru
 
Registered: May 2003
Location: London, UK
Distribution: Ubuntu 10.04, mostly
Posts: 6,007

Rep: Reputation: 366Reputation: 366Reputation: 366Reputation: 366
Thanks.

It looks like /dev/sda1 is no longer mounted (though it probably was in your post #12).

Please try the following:

1] Remove all reference(s) to /dev/sda1 from /etc/fstab

2] Run the following commands
Code:
sudo mkdir /media/video               # Make a mountpoint for /dev/sda1
sudo chown chaz:chaz /media/video     # chaz owns this mountpoint
sudo chmod 770 /media/video           # and only he can use it
rmdir /home/chaz/video                # remove the previously created directory
ln -sT /media/video /home/chaz/video  # and replace it with a symlink to the mountpoint of /dev/sda1
If you get errors you do not understand tell us exactly what they are.

3] Now add this line to /etc/fstab
Code:
/dev/sda1  /media/video  ext4  0  1
4] Reboot

Your videos should now be where you expect to find them.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to recover my encrypted Home directory pazzport Linux - Desktop 7 05-14-2012 11:30 PM
using encrypted home directory with xubuntu 9.10 live usb joe2748 Ubuntu 1 02-23-2010 04:54 AM
LXer: Ubuntuís Encrypted Home Directory: A Canonical Approach to Data Privacy LXer Syndicated Linux News 0 10-22-2009 10:31 PM
/home directory in fstab gothicbob Linux - Newbie 7 10-06-2008 05:19 PM
Fstab not taking a mount of a sub directory? Rufus330Ci Linux - Networking 3 02-15-2006 01:20 PM


All times are GMT -5. The time now is 01:02 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration