Cannot mount unencrypted directory to encrypted home directory with fstab?
UbuntuThis forum is for the discussion of Ubuntu Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I retry'd partitioning and formatting the disk. I didn't use a liveCD, rather just my running system. It seems that I can't even partition the disk with parted! Parted says that the device is busy, the same way mount does! This is a total nightmare.
Code:
chaz@brutus:~$ sudo fdisk /dev/sda
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').
Command (m for help): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): d
Selected partition 1
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-121601, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-121601, default 121601):
Using default value 121601
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
chaz@brutus:~$
chaz@brutus:~$ sudo find / -type d -exec sh -c 'mountpoint -q "${1}" && echo "${1}"' '{}' '{}' \;
/
/proc
/proc/sys/fs/binfmt_misc
/proc/fs/nfsd
find: `/proc/2224/task/2224/fd/5': No such file or directory
find: `/proc/2224/task/2224/fdinfo/5': No such file or directory
find: `/proc/2224/fd/5': No such file or directory
find: `/proc/2224/fdinfo/5': No such file or directory
/home
/home/chaz
find: `/home/chaz/.gvfs': Permission denied
/sys
/sys/fs/fuse/connections
/sys/kernel/debug
/sys/kernel/security
/lib/init/rw
/var/lock
/var/run
/dev
/dev/shm
/dev/pts
chaz@brutus:~$
Then, I plugged in Drive1 as well, rebooted and manually mounted it (with no problems) and copied the entire contents of the old home partition from Drive1 onto the new, encrypted home directory on Drive2. This transferred all my files and my settings to the new system ...
I once tried to have a shared home directory with Ubuntu and fedora. It did not work out. The settings were not recognized by both systems and my desktop was messed up. So there *might* be a chance that copying the hidden settings over to your new system is the source of trouble.
Since during installation your old drive was unplugged you could post your grub.cfg file, just to make sure that the devices do not get mixed up there.
After all you might have to reinstall on your old harddisk. When you copy your files over again then do not copy the hidden files. Only copy the data, i.e. the 'visible' directories.
After all you might have to reinstall on your old harddisk. When you copy your files over again then do not copy the hidden files. Only copy the data, i.e. the 'visible' directories.
Since installing Ubuntu takes all of like 10 minutes nowadays, I'm willing to entertain the possibility of installing a fresh system on the unmountable HDD, and migrating my /home data over. However, with my current home directory being encrypted, will I be able to do that? Won't it just look like random data when I mount it to the new system?
Since installing Ubuntu takes all of like 10 minutes nowadays, I'm willing to entertain the possibility of installing a fresh system on the unmountable HDD, and migrating my /home data over. However, with my current home directory being encrypted, will I be able to do that? Won't it just look like random data when I mount it to the new system?
You can remove the encryption. Hopefully you can do this from the Ubuntu install CD before reinstalling Ubuntu: https://help.ubuntu.com/community/En...ectory%20Setup http://art.ubuntuforums.org/showthread.php?t=1258294
In the future, I would avoid using an encrypted home directory in Ubuntu. I have read a number of threads where an encrypted home directory caused no end of problems, such as the problem you have been having with it.
There is also a bit of a performance penalty when using an encrypted home directory.
I use encrypted disks instead of just an encrypted home directory. But If I understood correctly then the OP will have to backup his data before removing the encryption from his home directory. Since the other disk cannot be mounted this might be a problem.
@OP: before you remove the encryption boot from a liveCD. Then try to mount your home directory with the liveCD and check if you can access your data. IIRC it is on a seperate partition, right? In order to mount an encrypted partition I use cryptsetup. But I am not 100% sure if this procedure can be applied with an encrypted home.
In any case, do not remove the encryption. The links tommcd provided also contain instructions to recover your home manually. Use these instructions to mount your home on your new system on /mnt and then copy the data (not the hidden setting files) over to your new home.
previously I said that you should not copy the hidden folders over to your new system. However, since I do not know your setup, you should make a backup of them. I.e. create a directory like
mkdir /home/chaz/bkp
and copy the hidden files and folders (.dir or .file) into the backup directory. Some might contain important data. This way you could also restore your settings one step at a time. If something breaks then you will know where to look in order to repair it.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.