It is currently Fri May 24, 2013 4:24 pm

All times are UTC




Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: [HOWTO] Move your /home folder
PostPosted: Thu Apr 13, 2006 9:55 am 
Regular Zenwalker
Regular Zenwalker

Joined: Mon Mar 20, 2006 10:03 pm
Posts: 13
The following steps explain how to move your home folder to its own partition  in order to keep your settings after reinstalling Zenwalk (root permissions required).

Please be carefull and backup your important data!!!

1. Create a new partition or use an existing one which is still unused (no FAT or NTFS partitions as they don't support file permissions). Partitions can be created using cfdisk.  It doesn't matter whether it is a primary or an extendend partition. Afterwards I would recommend a reboot.

2. Your new partition needs a filesystem. According to your preferences use mkfs.ext3 or mkfs.xfs.

Code:
mkfs.ext /dev/???

Code:
mkfs.xfs /dev/???


Please be aware that you will loose your data if you choose the wrong device! Be carefull and recheck devices! (??? is your target partition)

3. Mount the new partition. Create a folder in /mnt. e.g. mkdir /mnt/newhome. Then do:

Code:
mount /dev/??? /mnt/newhome


4. Now you are ready to copy (not move) your data. No files should be open, so do this step in single user mode. You can get there by:

Code:
init 1


Login

Go to /home and copy your data with:

Code:
cp -ax * /mnt/newhome


6. Move your old /home folder:

Code:
mv /home /oldhome


Create a new home folder:

Code:
mkdir /home


Leave single user mode.

Code:
exit


Login

Code:
init 4


7. Edit /etc/fstab according to your filesystem.

Code:
/dev/??? /home xfs [b] OR [/b] ext3 defaults 1 2


8. If you are sure that everthing went right, you can remove your old home folder. Or keep it in place as long as you are sure that everything works fine.

Good Luck,

JustusJonas


Last edited by justusjonas on Thu Apr 13, 2006 9:58 am, edited 1 time in total.

 Profile Send private message  
 
 Post subject: Re: [HOWTO] Move your /home folder
PostPosted: Fri Apr 14, 2006 12:16 am 
Senior Zenwalker
Senior Zenwalker
User avatar

Joined: Tue Mar 28, 2006 6:29 pm
Posts: 286
Location: London, UK
Would this also work if you had multiple linux distros on one drive? As in, would both distros be able to share the same /home directory?

_________________
Image
Image


 Profile Send private message  
 
 Post subject: Re: [HOWTO] Move your /home folder
PostPosted: Fri Apr 14, 2006 6:06 am 
Global Moderator
Global Moderator
User avatar

Joined: Fri Mar 10, 2006 4:46 am
Posts: 3631
Location: Still on IPv4
That depends on your UID (user ID). That should be the same for every distro then, that could be tricky.

_________________
Leenucks - the greatest thing since evolution theory || Questions about forum etiquette? Feel free to PM me.


 Profile Send private message  
 
 Post subject: Re: [HOWTO] Move your /home folder
PostPosted: Sat Apr 15, 2006 1:04 pm 
Senior Zenwalker
Senior Zenwalker
User avatar

Joined: Tue Mar 28, 2006 6:29 pm
Posts: 286
Location: London, UK
Right, I see...

Well, what if it is the same. This UID is just your username, right? Or is it more?

_________________
Image
Image


 Profile Send private message  
 
 Post subject: Re: [HOWTO] Move your /home folder
PostPosted: Sat Apr 15, 2006 4:58 pm 
Experienced Zenwalker
Experienced Zenwalker
User avatar

Joined: Sat Mar 11, 2006 2:53 pm
Posts: 208
Location: Estonia
Quote:
Well, what if it is the same. This UID is just your username, right? Or is it more?


It is nummerical value of user's ID.
You can see this value using as root:
Code:
userconfig

-> list users

or

as root:
Code:
vipw

the third value is uid


 Profile Send private message  
 
 Post subject: Re: [HOWTO] Move your /home folder
PostPosted: Sat Apr 15, 2006 6:56 pm 

Quote:
Would this also work if you had multiple linux distros on one drive? As in, would both distros be able to share the same /home directory?


It's not only the uid/gid that's different!
Btw. you get all your uid/gid info with 'id' ;)

I put in the same login name for all installations but diffrent home directories
in /etc/passwd and linked my mail/browser/sound/media directories.

This way, i can login with my standard account name and have all important
directories (mail!!!) only once.

til


Last edited by til on Sat Apr 15, 2006 7:15 pm, edited 1 time in total.

  
 
 Post subject: Re: [HOWTO] Move your /home folder
PostPosted: Sat Apr 15, 2006 10:59 pm 
Master Zenwalker
Master Zenwalker

Joined: Wed Mar 15, 2006 3:05 pm
Posts: 684
Location: Norridge, IL
I do things slightly differently because some of the XFCE settings don't migrate smoothly.  Instead of having a /home partition, I like to keep my settings in a place that gets backed up regularly and then I link to my settings from my home directory. 

For instance, I link to
  • .mozilla
  • .azureus
  • .gftp
  • .thunderbird
  • .gaim
  • .macromedia
  • .ssh

This way I can keep the settings that stay the same and I can wipe out /home if it is convenient.

By the way, I don't keep my files in /home.  I created my own non-standard partition (/data) so that I have a place to keep my files that is not the default target of any install script.

PS
I wish NTFS could symlink ;)

Update

My script:
Code:
#!/bin/sh
# mklnks.sh
# Michael
# 29 October 2006
#
#settings
ln -s /data/Documents/michael/.azureus
ln -s /data/Documents/michael/.gaim
ln -s /data/Documents/michael/.gftp
ln -s /data/Documents/michael/.macromedia
ln -s /data/Documents/michael/.mozilla
ln -s /data/Documents/michael/.ssh
ln -s /data/Documents/michael/.thunderbird
#
# data
ln -s /data
#
# mp3 ripping
# there is not enough space on / for ripping
ln -s /data/mp3


Remember to leave spaces (and underscores) out of your script's name!

You must run this script in ~/.

Obviously you will have to change the script to point to the copies of your settings. 

To run the script:
Code:
sh /path/to/script/mklnks.sh

_________________
Nigerian Officer: "Star Monkeys on the scope, sir. ...thousands of them!"
---
Join Team Zenwalk
Current Wallpaper


Last edited by michael on Mon Oct 30, 2006 5:24 am, edited 1 time in total.

 Profile Send private message  
 
 Post subject: Re: [HOWTO] Move your /home folder
PostPosted: Sun Apr 16, 2006 5:34 am 

Quote:
I wish NTFS could symlink


you can create symlinks :)

http://www.sysinternals.com/Utilities/Junction.html

cheers
til


  
 
 Post subject: Re: [HOWTO] Move your /home folder
PostPosted: Tue Jul 04, 2006 3:09 am 
Regular Zenwalker
Regular Zenwalker

Joined: Sat Jul 01, 2006 2:48 am
Posts: 27
Currently my root partition takes up my whole hd. Is there a way to make a home partition without having to reinstall?


 Profile Send private message  
 
 Post subject: Re: [HOWTO] Move your /home folder
PostPosted: Tue Jul 04, 2006 5:41 am 
Master Zenwalker
Master Zenwalker

Joined: Wed Mar 15, 2006 3:05 pm
Posts: 684
Location: Norridge, IL
What type is your partition?  (Ext 2, Ext 3, Reiser, XFS; other.)

_________________
Nigerian Officer: "Star Monkeys on the scope, sir. ...thousands of them!"
---
Join Team Zenwalk
Current Wallpaper


 Profile Send private message  
 
 Post subject: Re: [HOWTO] Move your /home folder
PostPosted: Tue Jul 04, 2006 6:12 pm 
Promo Team
Promo Team
User avatar

Joined: Sun Mar 19, 2006 7:53 pm
Posts: 1607
Location: Denmark
jbridgman wrote:
Currently my root partition takes up my whole hd. Is there a way to make a home partition without having to reinstall?


Use GParted to shrink your partition. Then put another (logical) partition in the free space for home.


 Profile Send private message  
 
 Post subject: Re: [HOWTO] Move your /home folder
PostPosted: Wed Jul 05, 2006 2:10 am 
Regular Zenwalker
Regular Zenwalker

Joined: Sat Jul 01, 2006 2:48 am
Posts: 27
Do I need to run this under GNOME?


 Profile Send private message  
 
 Post subject: Re: [HOWTO] Move your /home folder
PostPosted: Thu Jul 06, 2006 3:29 pm 
Promo Team
Promo Team
User avatar

Joined: Sun Mar 19, 2006 7:53 pm
Posts: 1607
Location: Denmark
GParted is available for plain Zenwalk - but I was thinking that you'd probably want to download the GParted package you see on distrowatch and burn it to a CD-ROM ... and keep the CD-ROM for future situations.

Best regards,
Claus


 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC


 Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
 
cron