LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-21-2010, 05:00 PM   #1
james_larson
Member
 
Registered: Jul 2009
Posts: 31

Rep: Reputation: 0
Copying my /home directory to external usb drive help


ok im thinking of copying my /home directory by just click & dragging it to my external usb hard drive. then do a fresh reinstall. then just replace the new /home directory with the one on my hard drive(old home directory) will it have my original programs i used to have and all my settings & stuff?

-i have ubuntu
 
Old 12-21-2010, 05:04 PM   #2
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
will not mostly work
yes the data will be there but not the ownership and app gard permissions
you might want to use the -P option in "cp"
see:
Code:
cp --help
example
cp -RP /home/YourUser /dev/usb?
 
Old 12-21-2010, 05:06 PM   #3
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
Quote:
Originally Posted by james_larson View Post
ok im thinking of copying my /home directory by just click & dragging it to my external usb hard drive.
I can't know what will your GUI file manager of choice do with the files if you copy them that way. Specially when it comes to permissions, ownerships and hidden (dot) files.

I suggest instead using cp -a from command line. I insist on the importance of using -a to preserve ownerships and permissions, though files in your home directory shouldn't be hard to fix if you fail to preserve permissions. Alternatively you could use rsync or a similar tool.

Quote:
then do a fresh reinstall. then just replace the new /home directory with the one on my hard drive(old home directory) will it have my original programs i used to have
No. Programs don't live in $HOME. They usually live under /usr/, /bin/, /sbin/, /opt/ or somewhere else.

Quote:
and all my settings & stuff?
Yes. That usually lives at $HOME, just like the rest of the documents and personal data. However, you should make sure you are going to install the same version of every program, otherwise there could be incompatibility issues on the config files. Usually those are minor issues, but it depends on the program and the versions.

Out of curiosity, what is the problem that you are trying to fix with the re-installation of your OS? If you reinstall the same OS you usually get the same thing you have right now, unless you have messed something terribly outside your package manager.
 
Old 12-21-2010, 05:06 PM   #4
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
Hello james larson,

be aware, that if your USB-drive is formatted with FAT32 filesystem, you're files will lose their permissions. When copying them back to Linux, all files are seen as executable.

It is no problem to create a Linux-filesystem like ext3 on an USB-drive.

Don't you have a separate partition for your /home directory? if you have, you may do the reinstallation but be sure that /home is not new formatted.
If you don't have a separate /home partition, I'd strongly recommend to create one.

Markus

Last edited by markush; 12-21-2010 at 05:07 PM. Reason: typo
 
Old 12-21-2010, 05:09 PM   #5
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
Quote:
Originally Posted by markush View Post
Hello james larson,

be aware, that if your USB-drive is formatted with FAT32 filesystem, you're files will lose their permissions. When copying them back to Linux, all files are seen as executable.
That is true. This could be circumvented, however, by archiving the files using tar or 7z (or any similar tool). That is, as long as the total archive size doesn't exceed the max fat32 file size, which non-surprisingly is ridiculous for nowadays standards (4GB minus 1byte).
 
Old 12-21-2010, 05:13 PM   #6
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
Quote:
Originally Posted by i92guboj View Post
... That is, as long as the total archive size doesn't exceed the max fat32 file size, which non-surprisingly is ridiculous for nowadays standards (4GB minus 1byte).
This is true for FAT16, the size of FAT32 volumes can be up to 32GB.

Markus
 
Old 12-21-2010, 05:24 PM   #7
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
Quote:
Originally Posted by markush View Post
This is true for FAT16, the size of FAT32 volumes can be up to 32GB.

Markus
I am not talking about max volume size, but about max file size. For fat32 is for sure 4GB minus one byte. That's the max size you could use to archive files on a fat32 volume (using 7z or whatever else). You can create a multivolume archive, though.
 
Old 12-21-2010, 05:26 PM   #8
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
Quote:
Originally Posted by i92guboj View Post
I am not talking about max volume size, but about max file size...
@i92guboj: sorry, I missread that.

Markus

Last edited by markush; 12-23-2010 at 01:47 AM.
 
Old 12-22-2010, 08:53 PM   #9
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,324
Blog Entries: 28

Rep: Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142
james_larson, I have done similar things successfully to a FAT32 external drive (I left it FAT32 because, from time to time, I had to plug it into a Windows box).

I copy the non-hidden files in my home directory, then copy ONLY the hidden directories that contain configuration settings that I have changed or significant data that I need, primarily .fluxbox, .pan2, and .opera (which includes my mail store).

I also back up any files from /etc that I have changed significantly, such as smb.conf and rc.firewall.

When I restore the information into my new home, I restore all the public data, but I do not restore the hidden directories. I restore their contents into the new hidden directories in my new OS installation.

When I do this, I also take the opportunity to do house-cleaning and junk all the stuff I don't need any more.

Any permissions glitches (frankly, I can't recall any major ones), I can fix with chmod.

It may not be elegant, but it has worked for me through several computer upgrades.
 
Old 12-22-2010, 09:01 PM   #10
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally Posted by John VV View Post
will not mostly work
yes the data will be there but not the ownership and app gard permissions
you might want to use the -P option in "cp"
see:
Code:
cp --help
example
cp -RP /home/YourUser /dev/usb?

You're kidding, right?

A copy to a raw device node? That would render it useless till you
partition and format it again...
 
Old 12-22-2010, 09:03 PM   #11
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally Posted by james_larson View Post
ok im thinking of copying my /home directory by just click & dragging it to my external usb hard drive. then do a fresh reinstall. then just replace the new /home directory with the one on my hard drive(old home directory) will it have my original programs i used to have and all my settings & stuff?

-i have ubuntu

If your external device isn't formatted w/ a Linux file-system you'd
be best off using tar - that way your ownerships & permissions will
be preserved.


That said: your programs don't reside in home; personalised settings
for programs and menu entries may.



Cheers,
Tink
 
  


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
[SOLVED] Unable to own previously saved /home files on new external USB drive tonyawards Linux - Newbie 7 11-09-2010 09:16 PM
Help me use a external USB drive for my /home directory spydyee Linux - Hardware 13 01-20-2010 06:17 AM
Transferring/copying files to an external USB hard drive rasupi Linux - Newbie 1 12-17-2008 03:04 AM
Syncing your home directory on a USB Flash Drive neville310 Linux - Desktop 1 01-13-2007 05:30 AM
copying files from my home directory to my USB Flash Disk neo_phyte Red Hat 9 04-24-2006 12:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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