LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Copying my /home directory to external usb drive help (https://www.linuxquestions.org/questions/linux-newbie-8/copying-my-home-directory-to-external-usb-drive-help-851665/)

james_larson 12-21-2010 05:00 PM

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

John VV 12-21-2010 05:04 PM

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?

i92guboj 12-21-2010 05:06 PM

Quote:

Originally Posted by james_larson (Post 4199339)
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.

markush 12-21-2010 05:06 PM

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

i92guboj 12-21-2010 05:09 PM

Quote:

Originally Posted by markush (Post 4199344)
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).

markush 12-21-2010 05:13 PM

Quote:

Originally Posted by i92guboj (Post 4199346)
... 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

i92guboj 12-21-2010 05:24 PM

Quote:

Originally Posted by markush (Post 4199350)
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.

markush 12-21-2010 05:26 PM

Quote:

Originally Posted by i92guboj (Post 4199359)
I am not talking about max volume size, but about max file size...

@i92guboj: sorry, I missread that.

Markus

frankbell 12-22-2010 08:53 PM

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.

Tinkster 12-22-2010 09:01 PM

Quote:

Originally Posted by John VV (Post 4199342)
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...

Tinkster 12-22-2010 09:03 PM

Quote:

Originally Posted by james_larson (Post 4199339)
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


All times are GMT -5. The time now is 05:24 PM.