Jump to content

/home in seperate partition?


Owyn

Recommended Posts

I am looking at moving my /home/<user> directories to a seperate partition.My working plan is to:-Create the new partition (actually allready done) and formatted as ext3.-Logout and login as root. This way there should be no active use of /home.-Mount the new partition to /mnt/data-Copy the entire /home tree to /mnt/data/home-Rename the old /home to /home.old-Dismount new partition-Remount data partition to /-Add mount commands to local boot commands or automount partition-Logout/Login as user. Run quick test.-Shutdown/Reboot test.Will this work?

Link to comment
Share on other sites

Make sure Red Hat (that is your primary isn't it?) knows where your home is going to be located. I know that in Mandrake it has home attached to a specific partition like on mine it might be hda6. I assume that is what you meant at the end. If so, then I think it should work. Maybe someone has done it this way. I take it you have had it as part of a partition with your distro now? It is a good idea to have a separate partition so you don't lose everything when you do a reinstall or upgrade your version.

Link to comment
Share on other sites

It is a good idea to have a separate partition so you don't lose everything when you do a reinstall or upgrade your version.
Exactly what I was thinking. Also a start in organizing system for efficient backups.
Link to comment
Share on other sites

Hi Owyn I´m afraid this will not work without a re-install . . . . . in your ¨/home¨ are all your personal settings, mail, prefs etc. . . all the PATH´s on your system now are pointing to the location where the ¨/home¨ is now. So this would involve changing many scripts . . . ¨/home¨ on ¨/dev/hda1¨ is another thing than ¨/home¨ on ¨/dev/hda5¨ . . . What you could do is mount a /backup partition on /mnt/backup and move/copy all that is important there. Do a re-install and during the partition set-up allocate ¨/home¨ and ¨/usr¨ to separate partitions and leave ¨/backup¨ un-mounted ( safer, all that is not mounted can not be affected during a fatal crash ) Finish the install and manually mount ¨/backup¨ and put the files back in ¨/home¨ ( overwrite those that have prefs, mail, adresses, etc. ) After the job is done un-mount the backup partition, and only mount it when needed. I think this way it will be much simpler, quicker and safer without data-loss. My favorite partition table is://home/usr/swap ( shared by other distro´s )/backup ( not (auto)mounted, and shared by other distro´s ) ( large :) ) :rolleyes: Bruno

Link to comment
Share on other sites

//home/usr/swap ( shared by other distro´s )/backup ( not (auto)mounted, and shared by other distro´s ) ( large :) )
Tx. I think. (Still scratching head and mumbling. Fumbling for manual.... :rolleyes: )Make sure I understand this. You have a total of 5 normally used partitions.You do not use a /boot partition. Just folded into "/".You may have additional partitions for "/", "/home" and "/usr" for other distros.You use custom install options to seperate the partitions the way you want them.You rebuild /home from backup/home after a new install.You periodically update /backup to save new files/settings.I assume this also gets around a bunch of permission gotchas.
Link to comment
Share on other sites

Bingo !!And at each new install of new versions/other distro´s I copy files from /backup to the place I want them ( adresses and bookmarks in multiple distro´s )I even have a separate partition /music . . . . so I can reach it from every distro and it won´t be overwritten accidently at a new install or other stupid mistakes I make myself . . . :):rolleyes: Bruno

Link to comment
Share on other sites

Owyn . . Forgot this:If you multiboot windows . . you can make the /backup FAT32 . . so you can access read/write it from Windows too . . . . :rolleyes: Bruno

Link to comment
Share on other sites

I don't think you'll have to reinstall. If your new partition contains the exact same information as your old /home directory and you set it to mount at /home, the Linux system will effectively think that nothing has changed.The only thing you may have to change in your plan (I'm used to using Debian and editing the /etc/fstab file by hand to do this - it may be slightly different in other distros) is to create an empty directory called /home and set it as the mount point for your new home partition (after you've renamed the old /home to /home.old).I did a similar thing after I installed Knoppix to my hard drive. I copied the contents of /home to the other partition and then mounted that partition as /home. It all worked fine.Edit for clarity:So, my to-do list would be:-Create the new partition (actually allready done) and formatted as ext3.-Logout and login as root. This way there should be no active use of /home.-Mount the new partition to /mnt/data-Copy the entire /home tree to /mnt/data/home-Rename the old /home to /home.old* create a new empty directory called /home-Dismount new partition* add the line to fstab so it knows to mount this partition to /home* type "mount /home" to mount it-Logout/Login as user. Run quick test.-Shutdown/Reboot test.andy

Link to comment
Share on other sites

That's better, but you will still have a problem if you follow that exactly: You will end up with an extra "home" in the path (if you copy the home dir's to /mnt/data/home, and then change the mount from /mnt/data to /home, you'll end up with /home/home/foo or whatever, which is not what you want).I would make the following changes...* Mount the new partition temporarily at /mnt/home instead of /mnt/data - this will make it easier to see exactly what you are doing (and not tempt you to create that extra "home" directory).* Copy the existing home directories individually to /mnt/home (i.e. /mnt/home/foo, /mnt/home/bar, etc). Make sure that you either preserve the permissions and ownership, or re-set them correctly after the move. You don't want the user files owned by "root" as that may make them inaccessible to the user. In the "good old days" of command lines, one would use the "tar" command to do the move, as it handles the permissions correctly. If you're using a GUI-base file manager to do the move, see if there's an option to preserve the attributes.The rest of the list, with Andy's modifications, looks fine.He's also correct that no reinstall should be necessary. You're just moving some data around, and changing the mount so that it appears at the same location in the filesystem.- Mike

Link to comment
Share on other sites

You guys are right, but this would only take care of the /home partition . . . . I still think a re-install is the most simple solution to get all new partitions set up. . . . . :D:D Bruno

Link to comment
Share on other sites

Ooh. Yeah. Thanks for the corrections, Mike. :)And yeah, you're right Bruno. Sometimes reinstalling is nicer, especially if Owyn decides to change his partitions signifcantly (like you're suggesting).

Link to comment
Share on other sites

I still think a re-install is the most simple solution to get all new partitions set up.  . . . .
Bruno:I have decided to go the re-install route, but, I am going to defer it until I am ready to go with a new distro. I will use the new partition as a backup partition. Leaving it as ext3 as I do not plan to have any MS OS on this system. I am also going to create a dedicated data partition. It will store server data (SQL, Mail, Web for starters). This will also be shared between distros.I am not sure which distro I will use next on this system. Leaning towards Mandrake 9.2 if it is stable by the time I am ready. I still have a lot of testing and education I can do with the everything install I have for RH9.One more piece of fine tuning on the partition plan. Was wondering if it would be wise to create a relatively small (1GB) partition for /var/tmp ? This, like swap, would be shared between distros.
Link to comment
Share on other sites

Owyn, If you would make an extra partition use it for the /var and not only /var/tmp . . . /var/log is one directory who´s size does vary a lot so including that one could be wise. I would not share the /var partition with other distro´s though.

A "deluxe" partition table is: ( 15+ to spare )  500 MB for /  3 G for /usr  20 MB for /boot ( for a few extra kernels to boot from )  500 MB for /var ( a lot of writing is done in the /var/log's )  500 MB for /swap  7+ G for /home  7+ G for /backup ( storage )    Any extra space could be added to /home and /backup.
B) Bruno
Link to comment
Share on other sites

If you store a lot of ISO images, then you might want a little more space. I took mine and copied them to a fat32 partition so I can access them from anywhere. I had a fat32 that was not really being used so I copied everything there to make sure I did not lose it or have to redownload any images when I switch to the final on Mandrake 9.2. The main thing to do is to find an easy way to keep it simple so you don't lose anything or have to go through a lot of gyrations to get what you want. We have a habit of trying to make things harder than they really are!

Link to comment
Share on other sites

If you store a lot of ISO images, then you might want a little more space.
ISO Images. Thats nothing. I just passed the 30GB mark in MP3Pro files. I have been gradually rebuilding a library that got trashed when a drive went south. Took the "opportunity" to recode everything at MP3Pro 96K (roughly equivalent to MP3 160K). Expected size is about 50GB.Decided to put a new 120GB drive in the XP system. Will use that as storage point for now and network mount it as required. Main reason is that my burner is currently on the XP system. Future plans are to move that drive to the new (still to be built and distro unknown at this time) dedicated server as its second drive. That should give me loads of flexibility to play with new distros. It will also let me start testing NFS installs and system imaging.PS: That also points out my number one reason for keeping a MS system handy. MusicMatch Jukebox Plus and MusicMatch Radio MX are only available on MS. Number One is based on hours of use (basically all the time).PPS: Yes I do know there are audio applications for Linux. But the XP system has a Santa Cruz installed with digital 5.1 to my audio system. Working just fine and I aint changing that any time soon. B)
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...