New user's registration have been closed due to high spamming and low trafic on this forum. Please contact forum admins directly if you need an account. Thanks !

Moving home folder

Got problems with your B2 or B3? Share and get helped!
Post Reply
Cohan
Posts: 21
Joined: 12 Aug 2008, 15:42

Moving home folder

Post by Cohan »

I want to move the home-folder to an external drive attached by eSATA (which provides RAID-1). The home-folder seems to be mapped to /dev/mapper/bubba-storage by default. How does this work?

To complicate my life a bit I want to have the user-folders on the eSATA-drive but keep /home/admin|storage|web on the built-in drive.

Anyone who can explain the /dev/mapper or help me with my quest?

/Konrad
Cohan
Posts: 21
Joined: 12 Aug 2008, 15:42

Post by Cohan »

I don't know if it's overkill, but a possible answer lies in the /dev/mapper which I have found out to be Logical Volume Management. As I understand it the home-folder is a LVM that resides in sda2. Is it possible to create three LVMs in sda2 for admin, storage, and web respectively and then just mount those at proper locations, having the home folder on sdb1 is no problem.

I'll google around and see if I come up with something. Feel free to point me in the right direction if you know anything right away.

/Konrad
Cohan
Posts: 21
Joined: 12 Aug 2008, 15:42

Post by Cohan »

Talking to myself here, but hopefully someone else might benefit from it. :D

I found this excellent beginners guide to LVM.

Here's what I did:

First a warning: Make sure you have everything backed up someplace else. A typo or other unexpected events can rend the Bubba unbootable and you have to reinstall it, which includes a wipe of the /home-folder. I speak from experience.

1. Get the eSATA drive up and running. After my initial boot problems (see other post) everything works just fine after another boot.
2. Edit /etc/fstab so that the eSATA drive mounts on /home
3. Reboot (This is the only way I found to release the mount on /home)
4. Make a directory e.g. /mnt/oldhome and mount /dev/bubba/storage there.
5. Run the following command

Code: Select all

cp -P --preserve=all -x -r -v /mnt/oldhome/* /home/
6. Verify that the new home looks OK.
7. Unmount /mnt/oldhome
8. Use the LVM guide mensioned above to shrink /dev/bubba/storage and create /dev/bubba/admin and /dev/bubba/web. Format them with your filesystem of choice. (I used ext3)
9. Rename /home/admin, storage, and web. Recreate those dirs and mount the LVMs.
10. Copy the old content to the new folders.
11. Update /etc/fstab to include the new LVMs. I don't know if it's you must place them after the /home mount, but I did just to be sure.
12. Reboot.

The only drawback of this solution (apart from not beeing easy to set up) seems to be that on reinstalling Bubba all LVM:s are reset. Correct me if I'm wrong, but I think I have read that a reinstall would leave the /home folder intact, but at least with this setup it doesn't. Just something to bear in mind.

/Konrad

PS Maybe something to be moved to the HowTo-section?
Post Reply