restore internal HDD

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Post Reply
henno603
Level 1
Level 1
Posts: 13
Joined: Wed Mar 13, 2024 10:46 am

restore internal HDD

Post by henno603 »

Hi. My PC has 2 internal drives: 1 x SSD for the operating system, and 1 HDD for my user data (profiles, data, documents, photos, etc). Recently I upgraded from Mint 19.1 to 21.3. The SDD was reformatted as part of that process (but not the HDD). The upgrade was successful. However, after the upgrade Mint 21.3 now defaults to spare space on the SSD for saving my user data. And it doesn't access my user data on the HDD. Mint 21.3 shows the HDD under devices. And it sees the user data folder on the HDD. But I cannot access the data inside the folder. What do I need to do in order to configure the same prior setup (ie. user data on the HDD is accessed in Mint 21.3 File Manager in standard Documents, Music, Photos etc folders, and all new documents saved are on the HDD not SSD)? Thanks.
User avatar
xenopeek
Level 25
Level 25
Posts: 29615
Joined: Wed Jul 06, 2011 3:58 am

Re: restore internal HDD

Post by xenopeek »

henno603 wrote: Mon Mar 18, 2024 10:39 am And it sees the user data folder on the HDD. But I cannot access the data inside the folder.
Why can't you access the data -- what does it show when you go there in the file manager?
Image
User avatar
BG405
Level 9
Level 9
Posts: 2510
Joined: Fri Mar 11, 2016 3:09 pm
Location: England

Re: restore internal HDD

Post by BG405 »

A couple of questions:
I presume you previously had the HDD mounted as /home and maybe a data partition and that you used "Erase disk and install Linux Mint" rather than the "Something else.." and setting up the partitions?

If you are using a different username, you'll also need to take ownership of the mountpoint(s). (You probably need to do this anyway).

Assuming the HDD is mounted on startup (is it in your /etc/fstab?) you could link it to your SSD's /home directory.

NOTE: If /home was indeed on the HDD, you'll need to copy the .dotfiles to it before linking with the SSD /home.
Dell Inspiron 1525 - LM17.3 CE 64-------------------Lenovo T440 - Manjaro KDE with Mint VMs
Toshiba NB250 - Manjaro KDE------------------------Acer Aspire One D255E - LM21.3 Xfce
Acer Aspire E11 ES1-111M - LM18.2 KDE 64 ----Two ROMS don't make a WRITE
henno603
Level 1
Level 1
Posts: 13
Joined: Wed Mar 13, 2024 10:46 am

Re: restore internal HDD

Post by henno603 »

xenopeek wrote: Mon Mar 18, 2024 12:41 pm
henno603 wrote: Mon Mar 18, 2024 10:39 am And it sees the user data folder on the HDD. But I cannot access the data inside the folder.
Why can't you access the data -- what does it show when you go there in the file manager?
File manager lists the HDD under "Devices" as "500 GB Volume". It shows two folders in there: "hm" (my user name under the prior installation) and "timeshift" (I'm guessing this latter folder has the system snapshots in it from the prior installation). When I try to open "hm" folder there's two items inside: README.txt and Access-Your-Private-Data.desktop. The README.txt says: "This directory has been unmounted to protect your data. From the graphical desktop click on "Access your private data", or from comman line, run: ecrypts-mount-private". The Access-Your-Private-Data.desktop doesn't open when I double click on it.
henno603
Level 1
Level 1
Posts: 13
Joined: Wed Mar 13, 2024 10:46 am

Re: restore internal HDD

Post by henno603 »

BG405 wrote: Mon Mar 18, 2024 1:02 pm A couple of questions:
I presume you previously had the HDD mounted as /home and maybe a data partition and that you used "Erase disk and install Linux Mint" rather than the "Something else.." and setting up the partitions?

If you are using a different username, you'll also need to take ownership of the mountpoint(s). (You probably need to do this anyway).

Assuming the HDD is mounted on startup (is it in your /etc/fstab?) you could link it to your SSD's /home directory.

NOTE: If /home was indeed on the HDD, you'll need to copy the .dotfiles to it before linking with the SSD /home.
Yes, previously the HDD mounted as home no matter that the OS was on the SSD. For this installation I used "Something else.." and set up new partitions for SSD. HDD was left unchanged.

Previously, and for the current installation I'm using the same username.

File System / etc / fstab is as per attached / below:
Attachments
IMG_20240318_181855(1).jpg
henno603
Level 1
Level 1
Posts: 13
Joined: Wed Mar 13, 2024 10:46 am

Re: restore internal HDD

Post by henno603 »

I'm a relative newbie and not good with command line.

If fixing this might be easier by re-doing the installation including reloading the user data from backup, I can do that instead.

V grateful for instructions.

Goal is to get OS and swap partitions on SSD, plus all user data accessible in Home located on HDD.

During installation of Mint on SSD today, installer also required an EFI partition. Plus I think there's also a small free space partition on it (SSD).
User avatar
BG405
Level 9
Level 9
Posts: 2510
Joined: Fri Mar 11, 2016 3:09 pm
Location: England

Re: restore internal HDD

Post by BG405 »

I don't see a reference to /home in the fstab, so this must be under / (same partition). You could add an entry for it after copying the new config stuff over, but first need to deal with the encryption.

Unfortunately I have never used or dealt with encryption so hopefully someone who does will be able and willing to help with this one.

Thoughts: Do you have a bootable backup of the old LM OS? .. If so, the keys or whatever should be there?

Also, it's advised to post the text output (pasted between [code] .. [/code]) rather than screenshots. :wink:
Dell Inspiron 1525 - LM17.3 CE 64-------------------Lenovo T440 - Manjaro KDE with Mint VMs
Toshiba NB250 - Manjaro KDE------------------------Acer Aspire One D255E - LM21.3 Xfce
Acer Aspire E11 ES1-111M - LM18.2 KDE 64 ----Two ROMS don't make a WRITE
henno603
Level 1
Level 1
Posts: 13
Joined: Wed Mar 13, 2024 10:46 am

Re: restore internal HDD

Post by henno603 »

BG405 wrote: Mon Mar 18, 2024 3:00 pm I don't see a reference to /home in the fstab, so this must be under / (same partition). You could add an entry for it after copying the new config stuff over, but first need to deal with the encryption.

Unfortunately I have never used or dealt with encryption so hopefully someone who does will be able and willing to help with this one.

Thoughts: Do you have a bootable backup of the old LM OS? .. If so, the keys or whatever should be there?

Also, it's advised to post the text output (pasted between [code] .. [/code]) rather than screenshots. :wink:
The existing user data in HDD isn't encrypted, and I opted for no encryption in the new installation as well. Hopefully makes it easier.

Apologies for screenshot instead of text output... I'm communicating with you here from a separate computer...
User avatar
xenopeek
Level 25
Level 25
Posts: 29615
Joined: Wed Jul 06, 2011 3:58 am

Re: restore internal HDD

Post by xenopeek »

henno603 wrote: Mon Mar 18, 2024 2:07 pm The README.txt says: "This directory has been unmounted to protect your data. From the graphical desktop click on "Access your private data", or from comman line, run: ecrypts-mount-private". The Access-Your-Private-Data.desktop doesn't open when I double click on it.
Right-click inside the directory that has the README.txt, select to open a Terminal there from the context menu and then type ecrypts-mount-private and press Enter to run it. That will let you access the files from your encrypted old home directory so you can take a backup.

I give absolutely no warranty that this will work with home directory encryption but here are the general steps for use another partition for your /home directory: viewtopic.php?p=2445404#p2445404. It may work for home directory encryption if the username and the password are exactly the same as on the previous install. It may also not be possible to log in to the user account from the previous install this way. In that case you can create a new user account.

Otherwise or if instead you don't want to use home directory encryption again you'll need slightly different steps. After getting access to your encrypted old home directory create a new directory next to it like home/myfiles or whatever. Copy all the files to that home/myfiles directory to remove the encryption. After double-checking you have all the files remove (or rename) your home/username directory with the encrypted files. Then follow the above linked guide and at step 2 also copy the contents of the home directory — the directory with your username — of your current install to the home directory on the other partition, so next to where the myfiles directory also is. If all goes well after rebooting you should be able to log in again with your username, the home directory now on the other partition, and you can them move the decrypted files from the myfiles directory into your own home directory again.

Yeah complex. There are a lot of caveats with home directory encryption which is why I recommend full disk encryption when you want your files encrypted. Also because it's faster than home directory encryption. Anyway, very 1st step should be getting access to your encrypted files again and making sure you have a good backup of them in case anything goes wrong.
Image
henno603
Level 1
Level 1
Posts: 13
Joined: Wed Mar 13, 2024 10:46 am

Re: restore internal HDD

Post by henno603 »

xenopeek wrote: Mon Mar 18, 2024 3:54 pm
henno603 wrote: Mon Mar 18, 2024 2:07 pm The README.txt says: "This directory has been unmounted to protect your data. From the graphical desktop click on "Access your private data", or from comman line, run: ecrypts-mount-private". The Access-Your-Private-Data.desktop doesn't open when I double click on it.
Right-click inside the directory that has the README.txt, select to open a Terminal there from the context menu and then type ecrypts-mount-private and press Enter to run it. That will let you access the files from your encrypted old home directory so you can take a backup.

I give absolutely no warranty that this will work with home directory encryption but here are the general steps for use another partition for your /home directory: viewtopic.php?p=2445404#p2445404. It may work for home directory encryption if the username and the password are exactly the same as on the previous install. It may also not be possible to log in to the user account from the previous install this way. In that case you can create a new user account.

Otherwise or if instead you don't want to use home directory encryption again you'll need slightly different steps. After getting access to your encrypted old home directory create a new directory next to it like home/myfiles or whatever. Copy all the files to that home/myfiles directory to remove the encryption. After double-checking you have all the files remove (or rename) your home/username directory with the encrypted files. Then follow the above linked guide and at step 2 also copy the contents of the home directory — the directory with your username — of your current install to the home directory on the other partition, so next to where the myfiles directory also is. If all goes well after rebooting you should be able to log in again with your username, the home directory now on the other partition, and you can them move the decrypted files from the myfiles directory into your own home directory again.

Yeah complex. There are a lot of caveats with home directory encryption which is why I recommend full disk encryption when you want your files encrypted. Also because it's faster than home directory encryption. Anyway, very 1st step should be getting access to your encrypted files again and making sure you have a good backup of them in case anything goes wrong.
Thanks vm for these instructions. There was no encryption of the original home directory / HDD. And I also de-selected encryption for the new installation. Apologies if this wasn't clear earlier. I'm hoping it means none of the issues around encryption arise...
henno603
Level 1
Level 1
Posts: 13
Joined: Wed Mar 13, 2024 10:46 am

Re: restore internal HDD

Post by henno603 »

xenopeek wrote: Mon Mar 18, 2024 3:54 pm
henno603 wrote: Mon Mar 18, 2024 2:07 pm The README.txt says: "This directory has been unmounted to protect your data. From the graphical desktop click on "Access your private data", or from comman line, run: ecrypts-mount-private". The Access-Your-Private-Data.desktop doesn't open when I double click on it.
Right-click inside the directory that has the README.txt, select to open a Terminal there from the context menu and then type ecrypts-mount-private and press Enter to run it. That will let you access the files from your encrypted old home directory so you can take a backup.

I give absolutely no warranty that this will work with home directory encryption but here are the general steps for use another partition for your /home directory: viewtopic.php?p=2445404#p2445404. It may work for home directory encryption if the username and the password are exactly the same as on the previous install. It may also not be possible to log in to the user account from the previous install this way. In that case you can create a new user account.

Otherwise or if instead you don't want to use home directory encryption again you'll need slightly different steps. After getting access to your encrypted old home directory create a new directory next to it like home/myfiles or whatever. Copy all the files to that home/myfiles directory to remove the encryption. After double-checking you have all the files remove (or rename) your home/username directory with the encrypted files. Then follow the above linked guide and at step 2 also copy the contents of the home directory — the directory with your username — of your current install to the home directory on the other partition, so next to where the myfiles directory also is. If all goes well after rebooting you should be able to log in again with your username, the home directory now on the other partition, and you can them move the decrypted files from the myfiles directory into your own home directory again.

Yeah complex. There are a lot of caveats with home directory encryption which is why I recommend full disk encryption when you want your files encrypted. Also because it's faster than home directory encryption. Anyway, very 1st step should be getting access to your encrypted files again and making sure you have a good backup of them in case anything goes wrong.
In your suggestion above you write "Right-click inside the directory that has the README.txt, select to open a Terminal there from the context menu and then type ecrypts-mount-private and press Enter to run it. That will let you access the files from your encrypted old home directory so you can take a backup."

I have tried this and get back "ERROR: Encrypted private directory is not set up properly". I don't believe it was set up to be encrypted in the first place. Perhaps that explains the error message? Is there an alternative command for non-encrypted contents?

In regards to a back up, I already have one from before starting the new LM installation.

Is there an easy way to change the default set up for LM 21.3, such that LM OS and swap, EFI are on partitions of the SSD, and the HDD is home directory? I don't mind redoing the installation and loading the backed up data to HDD after, if this is easier.
User avatar
xenopeek
Level 25
Level 25
Posts: 29615
Joined: Wed Jul 06, 2011 3:58 am

Re: restore internal HDD

Post by xenopeek »

henno603 wrote: Tue Mar 19, 2024 9:14 am Is there an easy way to change the default set up for LM 21.3, such that LM OS and swap, EFI are on partitions of the SSD, and the HDD is home directory? I don't mind redoing the installation and loading the backed up data to HDD after, if this is easier.
Define easy. You will have to use manual partitioning and use it to create all the partitions, set their mount points and types correctly.

You don't need to redo the installation. If you already have a backup of your old home directory and you're fine with restoring the backup, you can instead:
1. Format the HDD as ext4 with the Disks program, that erases everything on it
2. Run lsblk -o +UUID to find the UUID of the ext4 partition on the HDD
3. Then edit your /etc/fstab file with xed admin:///etc/fstab and add a line like below, where you replace long-string with the UUID of the new home partition:

Code: Select all

UUID=long-string	/home    	ext4      	rw,relatime	0 2
4. For the final step you need to boot from the Linux Mint installation USB. Open its file manager, right click in the file manager window and select to open as administrator/open as root so you have a file manager window where you can do system operations, then browse to the root partition on the SSD and:
- rename its home directory to home.old
- create a new empty home directory; the owner and permissions should be the same as on home.old
- then copy the contents of the home.old directory to the HDD partition -- don't copy the home directory itself, only the subdirectories in it

When you reboot the HDD partition will be mounted to the new /home directory and you should be able to log in. If everything works you can remove the /home.old directory.
Image
henno603
Level 1
Level 1
Posts: 13
Joined: Wed Mar 13, 2024 10:46 am

Re: restore internal HDD

Post by henno603 »

Thanks for your help!
Post Reply

Return to “Storage”