LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 08-11-2018, 07:10 PM   #16
Kronstadt1921
LQ Newbie
 
Registered: Apr 2015
Distribution: Linux Mint 18.3
Posts: 20

Original Poster
Rep: Reputation: Disabled
3rd Draft


Thanks joe_2000 and tofino_surfer for your feedback. Here's my revised plan based on my understanding of your comments:

1. Make backups using Timeshift and the native LM Backup Tool
2. Reboot from a USB stick
3a. Unmount /home and /newhome using the file viewer
3b. Mount root / using the file viewer
4. Copy contents of /home to /newhome using the following:
Code:
sudo rsync -aXSHv /media/mint/home/. /media/mint/newhome/.
5. Optionally, verify copying with:
Code:
sudo diff -r /media/mint/home /media/mint/newhome
6. Edit the /media/mint/etc/ftsab line changing "/newhome" to "/home" as follows:
Code:
UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx /home ext4 defaults 0 2
7. Backup the old /home as follows:
Code:
cd / && sudo mv /media/mint/home /media/mint/old_home && sudo mkdir /media/mint/home
8. Verify that /media/mint/home and /media/mint/old_home have same file permissions
9. When I am sure all has gone well:
Code:
cd / && sudo rm -rI /old_home

Last edited by Kronstadt1921; 08-11-2018 at 07:18 PM. Reason: renumbering
 
Old 08-13-2018, 02:59 PM   #17
joe_2000
Senior Member
 
Registered: Jul 2012
Location: Aachen, Germany
Distribution: Void, Debian
Posts: 1,016

Rep: Reputation: 308Reputation: 308Reputation: 308Reputation: 308
Quote:
Originally Posted by Kronstadt1921 View Post
Thanks joe_2000 and tofino_surfer for your feedback. Here's my revised plan based on my understanding of your comments:

1. Make backups using Timeshift and the native LM Backup Tool
2. Reboot from a USB stick
3a. Unmount /home and /newhome using the file viewer
3b. Mount root / using the file viewer
4. Copy contents of /home to /newhome using the following:
Code:
sudo rsync -aXSHv /media/mint/home/. /media/mint/newhome/.
5. Optionally, verify copying with:
Code:
sudo diff -r /media/mint/home /media/mint/newhome
6. Edit the /media/mint/etc/ftsab line changing "/newhome" to "/home" as follows:
Code:
UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx /home ext4 defaults 0 2
7. Backup the old /home as follows:
Code:
cd / && sudo mv /media/mint/home /media/mint/old_home && sudo mkdir /media/mint/home
8. Verify that /media/mint/home and /media/mint/old_home have same file permissions
9. When I am sure all has gone well:
Code:
cd / && sudo rm -rI /old_home
Hmm, there are some parts where your description is ambiguous and I am unsure whether you are aware of the subtilities, so just to be sure:

3a: If you boot from usb, neither will be mounted, so neither have to be unmounted
3b: When you say "root /" I am assuming you actually mean your root partition. You should verify that for everything that follows your root partition is mounted under /media/mint/
4. Just to be sure: I am also assuming that previously you had no separate home partition. This means that after 3b your old home partition's contents will be visible under /media/mint/home. Verify this before proceeding.
7. Two things: There is no need to cd to /
Second: In fact you don't need to mkdir. Just rename the newhome directory. So you end up with
Code:
sudo mv /media/mint/home /media/mint/old_home && sudo mv /media/mint/newhome /media/mint/home
 
Old 08-13-2018, 04:12 PM   #18
tofino_surfer
Member
 
Registered: Aug 2007
Posts: 483

Rep: Reputation: 153Reputation: 153
Quote:
7. Two things: There is no need to cd to /
Second: In fact you don't need to mkdir. Just rename the newhome directory. So you end up with
Code:

sudo mv /media/mint/home /media/mint/old_home && sudo mv /media/mint/newhome /media/mint/home
This is very wrong as they will just be moving their home directory back to its original location. They would have accomplished nothing except backing up the contents of their old /home directory to /old_home and doubling the disk usage on the SSD. They would just be copying back all of the data they copied to the HDD in step 4.

The OP had it right. They need to have an empty /home directory created with mkdir to serve as a mountpoint for the new /home partition on the HDD. The fstab entry in step 6 will use the UUID of the new /home partition to mount it on the new empty /home directory.

I'm not sure you understand what the OP is trying to do in this thread joe_2000.

Quote:
So I want to move the encrypted (eCryptfs) /home directory on my Linux Mint machine from my SDD to a HDD.
 
1 members found this post helpful.
Old 08-14-2018, 03:48 AM   #19
joe_2000
Senior Member
 
Registered: Jul 2012
Location: Aachen, Germany
Distribution: Void, Debian
Posts: 1,016

Rep: Reputation: 308Reputation: 308Reputation: 308Reputation: 308
Quote:
Originally Posted by tofino_surfer View Post
This is very wrong as they will just be moving their home directory back to its original location. They would have accomplished nothing except backing up the contents of their old /home directory to /old_home and doubling the disk usage on the SSD. They would just be copying back all of the data they copied to the HDD in step 4.

The OP had it right. They need to have an empty /home directory created with mkdir to serve as a mountpoint for the new /home partition on the HDD. The fstab entry in step 6 will use the UUID of the new /home partition to mount it on the new empty /home directory.

I'm not sure you understand what the OP is trying to do in this thread joe_2000.
Arf. Sorry. Don't know what I was thinking.
Thanks for catching that.
 
Old 08-14-2018, 03:59 AM   #20
joe_2000
Senior Member
 
Registered: Jul 2012
Location: Aachen, Germany
Distribution: Void, Debian
Posts: 1,016

Rep: Reputation: 308Reputation: 308Reputation: 308Reputation: 308
Quote:
Originally Posted by joe_2000 View Post
Arf. Sorry. Don't know what I was thinking.
Thanks for catching that.
The overall procedure is still wrong though as it lacks the mounting of the new home partition prior to rsyncing...
 
Old 08-17-2018, 07:49 AM   #21
joe_2000
Senior Member
 
Registered: Jul 2012
Location: Aachen, Germany
Distribution: Void, Debian
Posts: 1,016

Rep: Reputation: 308Reputation: 308Reputation: 308Reputation: 308
Quote:
Originally Posted by joe_2000 View Post
The overall procedure is still wrong though as it lacks the mounting of the new home partition prior to rsyncing...
Sorry for the brevity of this comment, I was posting from the mobile and did not since then get the chance to elaborate a bit further.

So as tolino_surfer suggested, your procedure in its current state would only move data around and not achieve what you desire.
The part he got wrong (and I failed to mention in my earlier post) was the reason, which isn't the renaming of the mount point I suggested but the fact that you never actually mount the new partition.

At this point I think this discussion probably caused more confusion than clarity, so let me try to suggest a revised procedure.
It may be worth noting that when operating from within a live system, entries in the target system's fstab will not affect the running session. In other words, you have to manually mount the new partition after mounting the root file system.

For the mount operations I find it less ambiguous to do it on the command line, as we don't know where the partitions show up when mounting with "the file viewer".
For the below steps I will assume that your current operating system partition is /dev/sdx1 and your new drive (that should be the new home partition) is /dev/sdy1. You will have to replace these device names with your real device names. (See bold text below)

So...

1. Make backups using Timeshift and the native LM Backup Tool
2. Reboot from a USB stick
3. Open a root shell, or open a shell and run
Code:
sudo -s
4. Create mount point for root partition of the os
Code:
mkdir -p /mnt/mint
5. Mount the root partition. Change the device name!
Code:
mount /dev/sdx1 /mnt/mint
You should now see the contents of the root partition under /mnt/mint. Verify this before proceeding
6. Backup the old /home as follows:
Code:
mv /mnt/mint/home /mnt/mint/old_home
7. Rename your mount point for the new home:
Code:
mv /mnt/mint/newhome /mnt/mint/home
8. Edit the /mnt/mint/etc/fstab line changing "/newhome" to "/home" as follows:
Code:
UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx /home ext4 defaults 0 2
9. Mount the new home partition. Change the device name!
Code:
mount /dev/sdy1 /mnt/mint/home
10. Copy data using the following:
Code:
rsync -aXSHv /mnt/mint/old_home /mnt/mint/home/
11. Verify that /mnt/mint/old_home and /mnt/mint/home have the same file permissions.

Reboot with fingers crossed. :-)

I should add one last disclaimer: I have never personally used ecryptfs for a home partition. But others in this thread have stated that this does not affect the procedure.
It might be worth checking that the actual data lives somewhere below /home. It's probably a hidden directory named .private or so but that's just an assumption.

Last edited by joe_2000; 08-17-2018 at 09:18 AM. Reason: Fixed typo in fstab path in step 8
 
Old 08-17-2018, 02:08 PM   #22
tofino_surfer
Member
 
Registered: Aug 2007
Posts: 483

Rep: Reputation: 153Reputation: 153
Quote:
So as tolino_surfer suggested, your procedure in its current state would only move data around and not achieve what you desire.
It isn't the OP's procedure that "would only move data around and not achieve what you desire" it is your post in post #17. The OP's original procedure before post 16 was correct. You are attributing your bad advice to the OP. The OP wanted to simply create a new mount point /home with mkdir, which was correct.

Quote:
The part he got wrong (and I failed to mention in my earlier post) was the reason, which isn't the renaming of the mount point I suggested but the fact that you never actually mount the new partition.
Your renaming of the mount point you suggested would have copied all data back to the SSD from the HDD.

If you are referring to the OP's post #16 they don't mount the new partition prior to resyncing. However in previous posts they do mount both /home and /newhome. You pointed this out in your post. The fact that I didn't repeat the error you already pointed out doesn't mean I got anything wrong.

My post in post 18 was intended solely to point out your bad suggestion of copying all data back to the SSD that was just copied to the HDD. You now attribute this suggestion to the OP.

As for your current post 21 there are several unnecessary and convoluted steps.

Quote:
7. Rename your mount point for the new home:
Code:

mv /mnt/mint/newhome /mnt/mint/home

9. Mount the new home partition. Change the device name!
Code:

mount /dev/sdy1 /mnt/mint/home
Step 7 is totally unnecessary and illogical. For some strange reason you are renaming the /newhome mount to /home and then mounting over top of it in step 9.
The OPs original procedure was less convoluted. It is simpler to create a new /home with mkdir. You have something against mkdir.
 
Old 08-17-2018, 08:31 PM   #23
joe_2000
Senior Member
 
Registered: Jul 2012
Location: Aachen, Germany
Distribution: Void, Debian
Posts: 1,016

Rep: Reputation: 308Reputation: 308Reputation: 308Reputation: 308
Quote:
Originally Posted by tofino_surfer View Post
It isn't the OP's procedure that "would only move data around and not achieve what you desire" it is your post in post #17. The OP's original procedure before post 16 was correct.
Well, post #16 was the draft on how to proceed. When applied it would have led to that exact result: Only moving data around. Can you agree to that? So all my subsequent comments where explicitly related to post #16.

Quote:
Originally Posted by tofino_surfer View Post
The OP wanted to simply create a new mount point /home with mkdir, which was correct.
Agreed, the step was correct. I should never have challenged it as the discussion about this created more confusion than benefit. My motivation was that in my understanding (which may be wrong) from the OP's original post the mountpoint /newhome has already been created.
This mountpoint is unneeded, and should hence be removed. So you could either
Code:
rmdir /mnt/mint/newhome && mkdir /mnt/mint/home
or
Code:
mv /mnt/mint/newhome /mnt/mint/home
The result is the same, but the second option is shorter. @OP: By all means, go with option 1 if you prefer, I am not going to argue about this.

Quote:
Originally Posted by tofino_surfer View Post
Your renaming of the mount point you suggested would have copied all data back to the SSD from the HDD.
Not if the HDD wasn't mounted.

Quote:
Originally Posted by tofino_surfer View Post
If you are referring to the OP's post #16 they don't mount the new partition prior to resyncing. However in previous posts they do mount both /home and /newhome.
Again: Post #16 contains the procedure that was about to be applied. Why should I refer to outdated posts?!?

Quote:
Originally Posted by tofino_surfer View Post
As for your current post 21 there are several unnecessary and convoluted steps.
In my opinion, my suggested procedure leads to the desired result, while the last draft in post #16 does not. Can you agree to that? I am asking this question because the outcome of this whole discussion should be that the OP has a procedure they can trust because everyone agrees to it. Go ahead and post a "less convoluted" procedure if you like. I am happy to confirm it as long as it achieves the desired result.

Quote:
Originally Posted by tofino_surfer View Post
Step 7 is totally unnecessary and illogical. For some strange reason you are renaming the /newhome mount to /home and then mounting over top of it in step 9.
The OPs original procedure was less convoluted. It is simpler to create a new /home with mkdir. You have something against mkdir.
As stated above, I believe the directory /newhome has already been created. It should be removed in the process, that's all. Nothing against mkdir.
Step #7 and the mounting in step #9 is definitely not unneeded. The HDD needs to be mounted somewhere. You could also create yet another mountpount (which in my opinion would increase convolution), but why not use the mountpoint that needs to be created in the target system anyways?!? It's a matter of taste and makes no technical difference whatsoever.

But again, by all means. Post a revised procedure. Let's try and help the OP achieve what they want to do.
 
Old 08-18-2018, 09:59 PM   #24
Kronstadt1921
LQ Newbie
 
Registered: Apr 2015
Distribution: Linux Mint 18.3
Posts: 20

Original Poster
Rep: Reputation: Disabled
Thanks to everyone who has replied. I'm sorry for the delay in responding. I'm hoping I'll have the energy in the next couple of days to wade back into this project. I appreciate your patience.
 
Old 01-09-2019, 09:00 PM   #25
Kronstadt1921
LQ Newbie
 
Registered: Apr 2015
Distribution: Linux Mint 18.3
Posts: 20

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Kronstadt1921 View Post
Thanks to everyone who has replied. I'm sorry for the delay in responding. I'm hoping I'll have the energy in the next couple of days to wade back into this project. I appreciate your patience.
I apologize for my long silence on this thread. Not long after I wrote the words above I was diagnosed with a brain tumor. This led to a lengthy scramble to explore treatment options. I had a series of radiation treatments in early December that have left me, among other things, even more fatigued than usual. I still plan to return to this thread again in the future as I still want to move my /home directory but it's going to be a while before I can dive back in. Any way, thanks to everyone who contributed.
 
Old 01-10-2019, 02:59 AM   #26
joe_2000
Senior Member
 
Registered: Jul 2012
Location: Aachen, Germany
Distribution: Void, Debian
Posts: 1,016

Rep: Reputation: 308Reputation: 308Reputation: 308Reputation: 308
Sorry to hear that! All the best to you, and certainly there is no need to apologize...
 
  


Reply

Tags
drives, ecryptfs, encryption, home



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
encrypted home directory insecure? danimalz Linux - Security 8 02-15-2017 05:29 PM
How to recover my encrypted Home directory pazzport Linux - Desktop 7 05-14-2012 11:30 PM
[SOLVED] Automount other harddrives while encrypted home directory sadarax Linux - Security 5 11-06-2011 07:59 PM
fsck or equivalent for my encrypted home directory cantab Ubuntu 2 09-20-2010 01:41 PM
Cannot mount unencrypted directory to encrypted home directory with fstab? Daravon Ubuntu 35 09-14-2010 03:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 03:47 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration