Author Topic: 2010 install and keeping /home directory  (Read 1156 times)

Offline Ditzian

  • Sr. Member
  • ****
  • Posts: 451
2010 install and keeping /home directory
« on: April 19, 2010, 05:20:08 AM »
Recently I copied a post from dieselbob57 that gave directions on how to keep the contents of the /home directory.  The directions involved recording the old UID, mounting the /home partition (I do not have one, I have only / and /data), and formatting only the system partition (what is that?).

1. I can no long find this post.  Should I assume that the directions were not entirely correct or universally applicable?

2. I have a /home directory that I would like to keep, but it is not a partition.  Is it possible to keep it, or is it necessary that it be its own partition in order to keep it?

3. Is it simply the case that a new install from the new CD should be entirely new, no attempt should be made to keep old content, and data backups should be on a separate disk or partition?

I ask these questions before I do the install, in part because, if it were possible to save things, but not the way I have them organized now, I would do the new install in such a way as to make this possible the next time.

Thank you,

Jan

Offline Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6380
  • I'm going South
Re: 2010 install and keeping /home directory
« Reply #1 on: April 19, 2010, 06:04:54 AM »
2. I have a /home directory that I would like to keep, but it is not a partition.  Is it possible to keep it, or is it necessary that it be its own partition in order to keep it?

Make a backup copy of /home (for instance with rsync). If you have space enough on your /data partition you could copy it there. Then you can copy whatever you need back afterwards.

The root partition (/) should be reformatted when you install a new version of PCLinuxOS and that will unfortunately erase everything in your /home too.

Quote
3. Is it simply the case that a new install from the new CD should be entirely new, no attempt should be made to keep old content, and data backups should be on a separate disk or partition?

With /home on a partition of its own, you could retain it, but even then the update to PCLinuxOS 2010 is such a big step that you might not want to if you have a backup. Your /data partition you can naturally retain. (Don't let the installer format it.)

Quote

I ask these questions before I do the install, in part because, if it were possible to save things, but not the way I have them organized now, I would do the new install in such a way as to make this possible the next time.

I'd split / into two partitions: / and /home, so that I wouldn't have to overwrite the configuration files in /home if I reinstall. For some people retaining everything on the data partition would be enough. It's also a question of how much disk space you have: the greater the number of partitions, the less economically you utilize the space on your hard drive.
« Last Edit: April 19, 2010, 08:02:02 AM by blackbird »
Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D

Offline Ditzian

  • Sr. Member
  • ****
  • Posts: 451
Re: 2010 install and keeping /home directory
« Reply #2 on: April 19, 2010, 07:22:08 AM »
Blackbird,

Thank you for the information.  I will follow the suggestion.  I have a 1 TB main drive, along with a 1/2 TB USB external drive.  My actual use has been restricted to formatting less than half the 1 TB drive, and I have not run out of space. 

I have been backing up everything I can think of to the USB drive, which still has room.  I believe that I need to think out where I store stuff in the first place, so I can keep better track of it.  The /data partition does not have everything that I might call "data."  For example, I should probably try to put my e-mail storage, music, videos, documents, pictures, and ham radio log files there, so a backup of /data would save those files in one swell foop.

Jan

Offline Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6380
  • I'm going South
Re: 2010 install and keeping /home directory
« Reply #3 on: April 19, 2010, 08:59:28 AM »
Blackbird,

Thank you for the information.  I will follow the suggestion.  I have a 1 TB main drive, along with a 1/2 TB USB external drive.  My actual use has been restricted to formatting less than half the 1 TB drive, and I have not run out of space.  

I have been backing up everything I can think of to the USB drive, which still has room.  I believe that I need to think out where I store stuff in the first place, so I can keep better track of it.  The /data partition does not have everything that I might call "data."  For example, I should probably try to put my e-mail storage, music, videos, documents, pictures, and ham radio log files there, so a backup of /data would save those files in one swell foop.

Jan


The difficult part is deciding how much space you should allocate to the partitions. I've several times been taken to task for my recommendations in this respect, but this is what I'd usually say:

On a typical PCLinuxOS system with a root partition, a home partition, and a swap partition, you should keep the root partition (/) relatively small compared to /home.

What does "relatively small" mean?

If /home is on a separate partition, you can have a perfectly usable system with a root partition of five gigabytes, but that would only let you run slightly more than a minimal set of standard programs. Double it and you'll still feel constrained. With a root partition of twenty gigabytes you're not likely to run out of space in normal circumstances, and with thirty you'll be able to install and test more programs than could possibly be of interest to you, unless they are very large. Going over forty would be ridiculous.

If you don't have a separate data partition, /home can't be too large (particularly if you store movies).

If you do have a separate data partition, /home doesn't need to be nearly as big as /. It would then mainly contain configuration files, and five gigabytes would probably be enough. (I'd give it ten, as I'm generous by nature. But even then almost all your data would have to go onto the data partition.)

Even if you have lots of RAM, you may also need a swap partition. For the reason why, see O-P's post here: http://www.pclinuxos.com/forum/index.php/topic,69910.msg573094.html#msg573094

When it comes to the data partition: the bigger, the better. Note that you don't have to mount it as /data. If you only have one user (apart from root), it makes much more sense to mount it somewhere under that user's home directory -- considering ownerships, permissions, and standards.
« Last Edit: April 19, 2010, 06:03:21 PM by blackbird »
Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D

Offline Ditzian

  • Sr. Member
  • ****
  • Posts: 451
Re: 2010 install and keeping /home directory
« Reply #4 on: April 19, 2010, 09:23:10 AM »

When it comes to the data partition: the bigger, the better. Note that you don't have to mount it as /data. If you only have one user (apart from root), it makes much more sense to mount it somewhere under that users home directory -- considering ownerships, permissions, and standards.


I have not considered the above because I did not know it.  Do you mean that I can have an independent partition on the drive, /data, yet mount it as if it were part of /home/jan, my home directory?  Can I also do this with /usr and local/usr, which is where my ham radio logging program installs itself (the install has been wrong, so it installs in one of those locations, but all references are to the other location, so I copy it there).  In other words, can I create a /usr partition, but mount it elsewhere.

Is there a reason not to mount either of these under /home/jan?  Would this change the internal references in the logging program, making them all wrong?  For example, if I were to mount the partition /usr/xlog as /home/jan/usr/xlog, would all the references in xlog still be looking for /usr/xlog, or would they find the correct files in the right place?

Now that I look at it, I am asking whether it is only OK to get away with this mounting scheme when you either manually look in the right place for data files or you have program control over where the program looks.  That would mean that it is not OK to mount actual programs in other than the exact place where they look for themselves.

Jan

Offline Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6380
  • I'm going South
Re: 2010 install and keeping /home directory
« Reply #5 on: April 19, 2010, 01:06:25 PM »
Do you mean that I can have an independent partition on the drive, /data, yet mount it as if it were part of /home/jan, my home directory?

Yes, sort of. The point is that the drive may be your data drive, but /data (with the slash) is a mountpoint, not a drive. If you have several partitions on the drive you can mount any one of them on /data, or /home/jan/data, or /home/jan/my_videos, or actually wherever you want. (With certain exceptions, as for instance under the /proc directory.)

The beauty of Linux/Unix is that you can transparently mount any partition anywhere, and it's just seen as another folder.

But the data partition doesn't become the /data folder (with the slash) unless you mount it there. (You could give it the label "data", and that it would retain wherever you mount it, but you wouldn't see the label in the file hierarchy.)

The slash in /data actually stands for the root directory (/) and indicates that /data is a subdirectory directly under / -- regardless of whether it's just an ordinary folder or a mountpoint for a partition. (Similarly /home/jan/data would be a subdirectory under a subdirectory under a subdirectory under / -- whether it's an ordinary directory or a mountpoint.)

(Note that the root directory is the same as the / directory. The /root directory is something else: the root user's home directory. Slashes are important.)

Quote
Can I also do this with /usr and local/usr, which is where my ham radio logging program installs itself (the install has been wrong, so it installs in one of those locations, but all references are to the other location, so I copy it there).  In other words, can I create a /usr partition, but mount it elsewhere.

A partition won't be a /usr partition unless it's mounted on /usr. (Although, if you want to confuse people, you may of course label it "usr", wherever you mount it. The label won't be seen in the filesystem hierarchy though -- except partially if the partition is automounted by HAL.) In your case the easier solution would probably be creating a few symbolic links that would make the system believe that /usr/local/<whatever> is /user/<whatever>.

Quote
Is there a reason not to mount either of these under /home/jan?

Well, for that they'd have to be on a separate partition. Even if your present /usr directory is on a partition of its own you have to mount it under /usr or the system won't find it, but if a subdirectory of /usr is on its own partition you could sometimes give it a mountpoint somewhere else.

You can mount any existing partition anywhere -- under /usr, or anywhere else. But you can't mount a part of the /usr partition, or a part any other partition, somewhere else. You can mount a subdirectory of /usr somewhere else, but only if that directory is on a separate partition.

In other words, you can only mount whole partitions. But I think you could achieve what you want to achieve using symbolic links.

Quote
Would this change the internal references in the logging program, making them all wrong?  For example, if I were to mount the partition /usr/xlog as /home/jan/usr/xlog, would all the references in xlog still be looking for /usr/xlog, or would they find the correct files in the right place?

That actually depends on how the program was written, on whether it uses relative or absolute addressing. This is true for symlinks too.

Quote
Now that I look at it, I am asking whether it is only OK to get away with this mounting scheme when you either manually look in the right place for data files or you have program control over where the program looks.  That would mean that it is not OK to mount actual programs in other than the exact place where they look for themselves.

Usually true. But note that if you want to change how you access a folder or a file you don't have to mount them in strange places. As I said, you could simply create a few symlinks.

I feel I've confused you enough. But that was an awful lot of questions.

[/quote]
« Last Edit: April 19, 2010, 01:42:31 PM by blackbird »
Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D

Offline Ditzian

  • Sr. Member
  • ****
  • Posts: 451
Re: 2010 install and keeping /home directory
« Reply #6 on: April 19, 2010, 05:06:28 PM »
Blackbird,

Thank you for the help.   My LiveCD boots, I am writing this now from the Firefox that is part of that distribution.  I am going to do some other chores, to see if I suddenly think of another file that I should back up.  If not, I will let the system reformat things.  I am going to set up a /home partition and a /data partition, along with the root partition.   I will probably make these larger than your recommendations--1 TB is a LOT of room..  I will include a swap partition as well.  I will reboot the old version so I can take a look at what I now have for partition sizes. 

The LiveCD recognized my printer and set it up with no intervention, and also recognized and set up my USB drive, which appears to be mounted much faster now.  Obviously, there was no problem with the internet, although I will have to do all the fussing with web site passwords and with e-mail.  The whole system is so much faster it is unbelievable.

Thank  you for the help and the recommendations.

Jan

Offline Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6380
  • I'm going South
Re: 2010 install and keeping /home directory
« Reply #7 on: April 19, 2010, 06:21:09 PM »
I am going to set up a /home partition and a /data partition, along with the root partition.   I will probably make these larger than your recommendations

I'm usually told that my recommendations are too liberal -- that nobody would need so much space for / as I recommend. But if you have a data partition it can't be too big unless you only store text files there.
Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D