Author Topic: Need help on how to save the Home folder if a Distro, for re-installing later  (Read 490 times)

0 Members and 1 Guest are viewing this topic.

Offline ssfc72

  • Member
  • Master
  • *
  • Posts: 1774
So I am trying to use the trick that Buster uses, to save the Home folder of a Distro, in order to re-install it back again in the same Distro, after a re-install or upgrade.

I am using the the GUI of the File manager in my Mint 19.1 Distro and when I try to save the Mint Home folder to a potable usb hdd, I get a message saying something like "cannot copy folder .gvfs, no permission to read".

Can someone give me the exact details, on how I go about storing a copy of my Mint Home folder on a usb hdd, so that I can copy it back to a new install of Mint 19.1???

Thanks!
Mint 19.1 on a Dell 14" Inspiron notebook, HP Pavilion X360, 11" k120ca notebook (Linux Lubuntu), Dell 13" XPS notebook computer (MX Linux)
Cellphone Samsung A50, PCMobile pay as you go

Offline fox

  • Member
  • Master
  • *
  • Posts: 1910
Can't you use Timeshift to save your Home folder?
Ubuntu 21.04 on 2019 5k iMac
Ubuntu 20.04 and 18.04 on Dell XPS 13 2 in 1

Offline William

  • Member
  • Explorer
  • *
  • Posts: 36
  • New Guy
1. Log in as root, and try copying your home directory.

2. Or, do it on command line.
Code: [Select]
cp -a /home/user /mnt/usb
3. Use separate partition for /home.

Offline ssfc72

  • Member
  • Master
  • *
  • Posts: 1774
Thanks for your help, William and Mike.

With the Mint Distro, I don't think you can log in as a Root user. I think you can only use the sudo command, in the Terminal, to get Root privileges?

The command line that you suggest, would I have to specify what usb, the portable usb hdd is?  ie  usb sdc1?

Also, I just remembered about right clicking on the Files slection in the Mint menu, to select Root privileges.   I did this and got "elevated" privledges, but I still got the complaint, "cannot copy folder, no permission to read". :-(

So, I remembered about using Puppy Linux and I booted up Puppy from a usb flash drive and had no problem copying the Mint Home folder to the portable usb hdd. :-)  Way to go, Puppy Linux. :-) 
Mint 19.1 on a Dell 14" Inspiron notebook, HP Pavilion X360, 11" k120ca notebook (Linux Lubuntu), Dell 13" XPS notebook computer (MX Linux)
Cellphone Samsung A50, PCMobile pay as you go

Offline fox

  • Member
  • Master
  • *
  • Posts: 1910
I'm curious why you didn't try Timeshift. It comes installed with Mint.
Ubuntu 21.04 on 2019 5k iMac
Ubuntu 20.04 and 18.04 on Dell XPS 13 2 in 1

Offline ssfc72

  • Member
  • Master
  • *
  • Posts: 1774
I am not familiar with how Timeshift works and I don't know if it would allow, only the Home folder to be restored or if Timeshift allows you to save to a portable usb hard drive, etc.
Where is Timeshiift found? It doesn't come up when I do a search for a program on the Mint menu?

Edit:  I went to Synaptic and installed Timeshift.  Unfortunately, I found that Timeshift says it can not put the Timeshift backup file, on a hdd that is formatted with the Microsoft file system. :-(   So that is a deal breaker, right there for me, since all my usb flash drives and portable external usb drives are formatted with a Windows file system.
« Last Edit: March 07, 2021, 01:01:55 pm by ssfc72 »
Mint 19.1 on a Dell 14" Inspiron notebook, HP Pavilion X360, 11" k120ca notebook (Linux Lubuntu), Dell 13" XPS notebook computer (MX Linux)
Cellphone Samsung A50, PCMobile pay as you go

Offline fox

  • Member
  • Master
  • *
  • Posts: 1910
I think I was partly wrong about Timeshift. I thought it was automatically installed with Mint 19 and up, but maybe not if you were upgrading an older version. In any event, it takes system snapshots, so it isn't the right tool for backing up your home folder. However, Mint has another tool that looks appropriate for that, called Mintbackup. Also, I would think that the Ubuntu tool, called either Deja dup or Backup, would also work. Any of them should be able to be set to back up on an external drive.  But if Puppy worked for you, you don't need any of these others unless you want to make current backups of your Home folder within Mint itself.
Ubuntu 21.04 on 2019 5k iMac
Ubuntu 20.04 and 18.04 on Dell XPS 13 2 in 1

Offline Jason

  • Administrator
  • Master
  • *****
  • Posts: 3637
  • Humanist. Skeptic. Husband.
Personally, I don't use Timeshift for home backups. I use it for system backups (just the / not including /home). Now, to solve your issue...

Many distros seem to mount external drives with root permission to write to them but you can read them fine. It bugs me. Your error seems to suggest a read error (from your home drive??). Regardless, the easiest way around it is to change the permissions of wherever you have the drive mounted to your user. The easiest way to do that is using the command-line. So, first, find out where your drive is mounted. You can do this graphically or by using the CLI. Now let's change the permissions:

Code: [Select]
sudo chown -R billy:billy /path/to/drive
- replace billy with whatever your username is and /path/to/drive to... should be obvious

That should be enough to let you write to the drive. But if not, you might also have to run:

Code: [Select]
sudo chmod -R 777 /path/to/drive
What I do is a bit different. Just so I don't have this annoying error in the future, I actually change the permissions of the upper folder where external drives are usually mounted (i.e. /media/billy) and then anything inserted should let me write and read from it. So here's how I do it as an example:

Quote
sudo chown -R jason:jason /media/jason
sudo chmod -R 777 /media/jason

What Buster is saying is that when he installs a distro, he puts /home on its own partition. That way when you install a new distro, you just mount that partition as /home and away you go! No backup is necessary although you should still do that.

"With all its sham, drudgery, and broken dreams, it is still a beautiful world." - Max Ehrmann, Desiderata

Offline Jason

  • Administrator
  • Master
  • *****
  • Posts: 3637
  • Humanist. Skeptic. Husband.
An easy way to find where it's mounted, assuming you know the size of it, is to run df like this:

Code: [Select]
df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            1.9G     0  1.9G   0% /dev
tmpfs           384M  3.1M  381M   1% /run
/dev/sda1       117G   66G   46G  59% /
tmpfs           1.9G  171M  1.8G   9% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           1.9G     0  1.9G   0% /sys/fs/cgroup
tmpfs           384M   24K  384M   1% /run/user/1000
/dev/sdb1        57G   25G   29G  47% /media/jason/4f3fdfdc-37b5-49f5-b977-e26a0c5c5be3

Therefore, I know that the USB drive connected to it is 64 GiB (sold in GiB but OSes show it in GB hence, the 57 GB shown)

Now you know where to copy the files. Note it's the drive name as listed on the right, not the left (i.e. NOT /dev/sdb1 in this case)
"With all its sham, drudgery, and broken dreams, it is still a beautiful world." - Max Ehrmann, Desiderata

Offline William

  • Member
  • Explorer
  • *
  • Posts: 36
  • New Guy
Edit:  I went to Synaptic and installed Timeshift.  Unfortunately, I found that Timeshift says it can not put the Timeshift backup file, on a hdd that is formatted with the Microsoft file system. :-(   So that is a deal breaker, right there for me, since all my usb flash drives and portable external usb drives are formatted with a Windows file system.
If Puppy just copied the directories, then you lost all the intricate permissions and other metadata of Linux filesystems.  Correct way, is to tar it up and save the tarball, which I doubt Puppy did.


Offline William

  • Member
  • Explorer
  • *
  • Posts: 36
  • New Guy
The command line that you suggest, would I have to specify what usb, the portable usb hdd is?  ie  usb sdc1?
You have to mount it first.  So, assuming /dev/sdc1 is the partition of external USB/HDD,

mount /dev/sdc1 /mnt/usb
cp -ax /home/user /mnt/usb

It will copy "user" directory to "/mnt/usb" directory, so you'll get /mnt/usb/user.  I added -x option (explained below).

Also, I just remembered about right clicking on the Files slection in the Mint menu, to select Root privileges.   I did this and got "elevated" privledges, but I still got the complaint, "cannot copy folder, no permission to read". :-(
Main reason of your trouble is that ~/.gvfs is mounted directory.  You can see by

$ mount
gvfsd-fuse on /home/user/.gvfs type fuse.gvfsd-fuse (...)

It's GNOME thing, but it's mounted even on KDE desktop like mine.  So, you have to skip that when copying (hence -x option).  Or, you can shutdown your desktop or boot up in terminal mode, then you don't need -x option.

Offline ssfc72

  • Member
  • Master
  • *
  • Posts: 1774
Thanks guys for the help.  That info is good to know.
Mint 19.1 on a Dell 14" Inspiron notebook, HP Pavilion X360, 11" k120ca notebook (Linux Lubuntu), Dell 13" XPS notebook computer (MX Linux)
Cellphone Samsung A50, PCMobile pay as you go

Offline ssfc72

  • Member
  • Master
  • *
  • Posts: 1774
Update.

Ok, I was successful in re-installing the Home folder of my Mint 19.1, on my notebook computer. 🙂

I booted up Puppy Linux from a usb flash drive on my Mint computer and I then deleted the Mint Home folder on the notebook computer and then re-installed the Home folder from a copy of the Mint Home folder that I stored on another usb hdd.
It took quite a few minutes for all the files to be copied back to the Home folder.

The Mint notebook works like nothing ever happened to the Home folder.
Mint 19.1 on a Dell 14" Inspiron notebook, HP Pavilion X360, 11" k120ca notebook (Linux Lubuntu), Dell 13" XPS notebook computer (MX Linux)
Cellphone Samsung A50, PCMobile pay as you go