LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux Mint
User Name
Password
Linux Mint This forum is for the discussion of Linux Mint.

Notices


Reply
  Search this Thread
Old 02-10-2015, 02:07 PM   #1
Steve W
Member
 
Registered: Mar 2007
Distribution: Linux Mint 18.1
Posts: 520

Rep: Reputation: 44
Quick transferral of /home directory files - but will it work?


Last year I installed Linux Mint 14 xfce to a friend's desktop PC. He and his wife are in their 60s, but they like Linux now they've got it. I did a dual boot, as they still need Win XP for some things. They had a large number of e-mails in Outlook Express format, which I transferred over to Thunderbird format, and now they are in the Linux partition.

Turned out, of course, that Mint 14 was a poor choice, as now it is out of date. I want to install Mint 17 Mate on there, and I'm thinking of the easiest way to do it.

Although most of their files are photos and Word documents located on the old Win XP partition, there's a few gigs of e-mails in their current /home directory and I'm trying to avoid having to back them up to a memory stick and then copy them back again to 17's new /home directory. These e-mails, in a Thunderbird profile folder, are the main constituent of their /home directory; along with of course the preferences for the programs they use in Linux.

Their HDD has plenty of room. If I installed 17 alongside 13 (and XP) temporarily (in case they still need anything from 13 they've forgotten), can I edit fstab and point their new /home to their old home directory? Or does that only work with whole partitions?

I know I can do:

Code:
/dev/sda2 /home ext4 defaults 0 0
... and this will point /home to the entire sda2 partition (assuming their old /home was located on sda2).

I know this solution is not ideal (or even, necessarily, permanent) but at least this way their old Linux will remain on the Grub menu and they can choose to boot up to Win XP, Mint 13 or Mint 17, without keeping their Linux files in two different places. If they boot back to Mint 13, their files will be there; and if they boot to Mint 17, its fstab will point to Mint 13's /home and the same files.

Would that work?

Last edited by Steve W; 02-10-2015 at 02:15 PM.
 
Old 02-10-2015, 02:52 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,338

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
Quote:
Originally Posted by Steve W View Post

If I installed 17 alongside 13 (and XP) temporarily (in case they still need anything from 13 they've forgotten), can I edit fstab and point their new /home to their old home directory? Or does that only work with whole partitions?

You can only mount partitions in fstab. You can use a symbolic link to link our new /home to your old /home. However instead of linking /home I would link to their data area. I recommend that:

You group all of the user data in Mint 14 into a directory called /home/username/data
Create a directory called /oldmint in your Mint 17 system.
Mount your Mint 14 partition on /oldmint in your Mint 17 /etc/fstab.
Symbolically link /home/username/data in Mint 17 to /oldmint/home/username/data

2nd solution:
The way that I do it for the best long term flexibility is create a partition for /home/username/data and then have all of my systems mount /home/username/data in /etc/fstab.

-----------------------
Steve Stites
 
Old 02-11-2015, 04:14 AM   #3
Steve W
Member
 
Registered: Mar 2007
Distribution: Linux Mint 18.1
Posts: 520

Original Poster
Rep: Reputation: 44
Hmm. Would one shortcut to creating a separate partition for /home, be to install Mint 17 alongside the other two systems (the installer should give me the option to do this) and then delete all systems files from the Mint 13 partition except the home directory; then mount that old partition as /home in Mint 17? (Then edit the grub files to remove Mint 13 from the Grub boot menu).

Steve
 
Old 02-11-2015, 07:30 AM   #4
TxLonghorn
Member
 
Registered: Feb 2004
Location: Austin Texas
Distribution: Mandrake 9.2
Posts: 702

Rep: Reputation: 231Reputation: 231Reputation: 231
Steve, boot into Mint on the hard drive and run the commands
Code:
inxi -pou
Code:
cat /etc/fstab
Code:
ls /home
so that we can see what you have to work with.

Last edited by TxLonghorn; 02-11-2015 at 07:55 AM.
 
Old 02-11-2015, 07:57 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,131

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
Create a new partition for /home, copy everything (including the "dot" files) over and mount it to make sure everything works. This will be permanent.
Create a new partition for Mint17. Install to the new partition, specifying the new /home in the partition setup phase. Create same user(s)/password(s). All will work like magic.

If it all goes to hell, simply reboot the old system. Flip-flop between the system partitions on future installs - that way you always have an instant back-out.
has worked for years, including Mint using TBird - although I've never jumped from Mint14 to Mint17.

As for not wanting to take a backup - see my sigline. Backups are not optional.
 
Old 02-11-2015, 08:25 AM   #6
cynwulf
Senior Member
 
Registered: Apr 2005
Posts: 2,727

Rep: Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367
Irrespective of the size of the data involved - if those "few gigs" of emails are important then they need to be backed up, however long it takes. Any partitioning operation is a risk and you risk losing all the data.

Just clear all of the temporary files and unneeded dot files from the user's /home directory (the browser caches should be the first to go) and tar the whole lot and put it on a memory stick or burn to a CD. Once the new system is installed you can just untar and it's job done.

If you're going to be the one maintaining this system, then make it easier for yourself and put, at least, /home on a separate partition. That way you can go in there and upgrade or install something else without all the hassle. This does not replace backups however - you could still make an error and format the wrong partition during install.

If mint has a short support release/cycle (?) then do yourself a favour and install something with a longer cycle to save constant reinstalls and upgrades.

Last edited by cynwulf; 02-11-2015 at 08:28 AM.
 
Old 02-11-2015, 08:47 AM   #7
TxLonghorn
Member
 
Registered: Feb 2004
Location: Austin Texas
Distribution: Mandrake 9.2
Posts: 702

Rep: Reputation: 231Reputation: 231Reputation: 231
When syg00 says, "Install to the new partition, specifying the new /home in the partition setup phase."... Since you have all your personal files and configuration files on that new /home partition, be sure to uncheck the green Format box.
DO NOT FORMAT.
You can designate it as /home, and preserve the files on it without formatting that partition.

And, very true... Backups are not optional.

Last edited by TxLonghorn; 02-11-2015 at 08:55 AM.
 
Old 02-11-2015, 10:11 AM   #8
Steve W
Member
 
Registered: Mar 2007
Distribution: Linux Mint 18.1
Posts: 520

Original Poster
Rep: Reputation: 44
Quote:
Steve, boot into Mint on the hard drive and run the commands
Well, I won't be round there until tomorrow afternoon, and then I'll do it all in one go. So I won't be asking for interim advice from LQ unless it all goes tits-up and I have to give up on getting it all done tomorrow afternoon.

However, if I do have to seek further clarifying advice, I'll be sure to run those commands and post the output here.

So... if I create a new partition using the installer (never done that before...), then I can specify that as /home in the same installation screen, and the installer will take care of fstab etc for me, automatically?
 
Old 02-11-2015, 10:26 AM   #9
TxLonghorn
Member
 
Registered: Feb 2004
Location: Austin Texas
Distribution: Mandrake 9.2
Posts: 702

Rep: Reputation: 231Reputation: 231Reputation: 231
Quote:
Originally Posted by Steve W View Post
So... if I create a new partition using the installer (never done that before...), then I can specify that as /home in the same installation screen, and the installer will take care of fstab etc for me, automatically?
I find it more convenient to use the gparted program first, to create the partitions I want, then run the installation program with the "Something Else" option. You would have to do that first, anyway, if you are going to follow the suggestion to put all the /home files on there - as suggested by syg00
Quote:
Create a new partition for /home, copy everything (including the "dot" files) over and mount it to make sure everything works. This will be permanent.
Create a new partition for Mint17. Install to the new partition, specifying the new /home in the partition setup phase. Create same user(s)/password(s).
Yes, the installer will configure fstab for you. Just do not format the /home partition if you have already copied your files there.
 
1 members found this post helpful.
Old 02-11-2015, 11:11 AM   #10
Steve W
Member
 
Registered: Mar 2007
Distribution: Linux Mint 18.1
Posts: 520

Original Poster
Rep: Reputation: 44
Could you, briefly, just give me a line I need to type into the terminal (using rsync for instance) that will back up this person's home directory to a memory stick. I did try Googling this, but there seems so many variations and caveats to doing this. For example, there is talk of not doing it while logged in because it won't copy over some of the hidden config files if you are still using the system when you copy. Others say you need a special switch for rsync so that file ownership details are maintained, especially if copying to a directory using FAT32 like a memory stick.

How about:

Code:
rsync -av /home/fred/ /media/USBDRIVE/
and then to restore:

Code:
rsync -av /media/USBDRIVE/ /home/newfred/
Would that work? Any caveats or suggestions? Slashes in the right place?
 
Old 02-11-2015, 03:14 PM   #11
TxLonghorn
Member
 
Registered: Feb 2004
Location: Austin Texas
Distribution: Mandrake 9.2
Posts: 702

Rep: Reputation: 231Reputation: 231Reputation: 231
If I had more info about the system, I could be more precise. In particular, it would be good to know if /home is actually a separate partition or not. You should want to run your backup from the live Mint DVD.
rsync -r -t -p -o -v --progress --delete -u -s /home/yourusername /media/mountpoint/backupfolder
is a tested command

You can add -n to it and run that first to check to see if it is doing exactly what you want.
-n performs a "dry-run" without actually changing anything.
 
1 members found this post helpful.
Old 02-11-2015, 05:56 PM   #12
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,131

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
Backups like /home should be done when not logged in - either in single user mode, or (better) from a liveCD.
Don't use lame fiesystems like [V]FAT - reformat the USB to something decent that understands file attributes. ext4 is my "go-to" when not using btrfs. I like fsarchiver when taking a full filesystem backup. It verifies the data for you.
 
1 members found this post helpful.
Old 02-12-2015, 03:26 AM   #13
Steve W
Member
 
Registered: Mar 2007
Distribution: Linux Mint 18.1
Posts: 520

Original Poster
Rep: Reputation: 44
Quote:
In particular, it would be good to know if /home is actually a separate partition or not
No, it isn't on a separate partition. Okay, I will run the backup from the live DVD before I install anything. Then I'll probably install into the partition containing the current Linux Mint 14, so I don't have to create any new partitions. Then I'll copy the backup of /home into the /home of the new Linux Mint 17, using the live DVD. Then hopefully boot into Mint 17 and find everything doing what it's meant to...

I don't have a spare memory stick with nothing on it that I can reformat to ext4. If I back up to a spare drive using rsync that is formatted NTFS, does the -p (or -a) switch still preserve permissions? I don't think it does, from what I can glean from the internet.

I suppose I could always not preserve the permissions and just do a CHOWN after I copy them back (they'll all be the same user permissions anyway...)

Last edited by Steve W; 02-12-2015 at 03:50 AM.
 
Old 02-12-2015, 07:41 AM   #14
TxLonghorn
Member
 
Registered: Feb 2004
Location: Austin Texas
Distribution: Mandrake 9.2
Posts: 702

Rep: Reputation: 231Reputation: 231Reputation: 231
Quote:
Originally Posted by Steve W View Post
I don't have a spare memory stick with nothing on it that I can reformat to ext4. If I back up to a spare drive using rsync that is formatted NTFS, does the -p (or -a) switch still preserve permissions? I don't think it does, from what I can glean from the internet.
I can't advise on using NTFS, because I have zero experience with that. It does not sound like a good option.
What I would do is resize the partitions on the memory stick or the spare drive, and create a new partition with ext formatting, for my backup.
ext2 would be my first choice for a backup partition on a usb flash drive, because the lack of journeling means less wear on the drive. ext4 includes journaling, which is fine for a hard drive, not so good for a flash drive.

Last edited by TxLonghorn; 02-12-2015 at 07:43 AM.
 
1 members found this post helpful.
Old 02-13-2015, 06:37 AM   #15
Steve W
Member
 
Registered: Mar 2007
Distribution: Linux Mint 18.1
Posts: 520

Original Poster
Rep: Reputation: 44
Successfully upgraded the system yesterday. In the event, after backing up the Thunderbird profile and Firefox config (the only data that needed to be kept - most of their stuff is Word documents on the Windows partition), I used GParted on the live DVD to split the existing 100Gb Linux partition into two 50 gigs (their current Linux only used 12Gb), then used the advanced partitioning option in the installer to set that new partition as root and install there.

Then, still on the live DVD, I used rsync to copy across the Thunderbird and Firefox profiles, bookmarks and settings and rebooting. It all worked. I did not give them a separate /home partition on this occasion; and the Linux Mint 17 Mate should be supported until 2019. And most of their stuff, as I said, is on the Windows partition anyway.

Two things of note:

(i) GParted was present on the DVD in live mode, but was not available on the installed distro, and had to be retrieved and installed separately. Go figure...

(ii) Is it wise to copy over the entire home directory from someone's previous install, especially if the distros are significantly different? Won't that potentially cause conflicts if the new distro has installed certain config files in the new /home, and these are overwritten by the config files from the previous distro? On this one, I was going from Mint 14 xfce to Mint 17 Mate, so not too much of a change. And don't the same problems arise when you have a separate /home partition?

Finally, thank you to the participants on this thread for your helpful advice and instructions - even if I did it in a different way in the end!
 
  


Reply



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
A Home Server With Media Files in Home Directory vs. /var/www/music slurt Linux - Server 2 05-11-2014 11:06 AM
Deleting certain files in the home directory from another directory {set} Linux - Newbie 9 02-10-2013 01:53 AM
home directory files gone, hidden files remain Grasshopper Linux - Security 12 04-10-2005 08:23 PM
automounting in /home directory doesn't work jlinkels Linux - Software 3 03-18-2005 05:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux Mint

All times are GMT -5. The time now is 08:10 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