Home on separate drive
Rashkae
ubuntu at tigershaunt.com
Wed Apr 23 23:02:01 UTC 2008
Darryl Tidd wrote:
> Hey guys, I'm having some trouble, hope you can help.
> I have installed a second hard drive and I would like to move my /home
> dir to it. I have read some tutorials, but I am having trouble
> figuring it out. This is the output of mount in terminal
> /dev/sda1 on / type ext3 (rw,errors=remount-ro)
> proc on /proc type proc (rw,noexec,nosuid,nodev)
> /sys on /sys type sysfs (rw,noexec,nosuid,nodev)
> varrun on /var/run type tmpfs (rw,noexec,nosuid,nodev,mode=0755)
> varlock on /var/lock type tmpfs (rw,noexec,nosuid,nodev,mode=1777)
> udev on /dev type tmpfs (rw,mode=0755)
> devshm on /dev/shm type tmpfs (rw)
> devpts on /dev/pts type devpts (rw,gid=5,mode=620)
> lrm on /lib/modules/2.6.22-14-generic/volatile type tmpfs (rw)
> securityfs on /sys/kernel/security type securityfs (rw)
> binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc
> (rw,noexec,nosuid,nodev)
> none on /proc/fs/vmblock/mountPoint type vmblock (rw)
> /dev/scd0 on /media/cdrom0 type iso9660 (ro,nosuid,nodev,user=dtidd)
> //192.168.0.1/QOPENSYS on /media/remote type cifs (rw,mand)
> /dev/sdb1 on /media/disk type ext3 (rw)
>
>
> This is my fstab
>
> # /etc/fstab: static file system information.
> #
> # <file system> <mount point> <type> <options> <dump> <pass>
> proc /proc proc defaults 0 0
> # /dev/sda1
> UUID=28107d44-f66e-4358-a2a3-a77be8002ce6 / ext3
> defaults,errors=remount-ro 0 1
> # /dev/sda5
> UUID=58e5f69c-5a65-4b32-9798-ae0dbafd2f0d none swap
> sw 0 0
> /dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec 0 0
>
>
> //server/share/media/remote cifs
> credentials=/home/user/credentials 0 0
> /dev/sdb1 /media/disk ext3 defaults 0 1
>
> Where /dev/sdb1 is my second hard drive.
>
> I understand that I need to mount /dev/sdb1 as /media/home for instance
> and I need to copy my current /home to the new /home, I'm just having
> trouble finding the method.
> Thanks
> Darryl Tidd
> N5DLT
>
You already have the drive mounted.. now you just need to copy your
existing home to the new drive. (it's best if as many programs are
closed as possible while doing this)
sudo cp -ax /home/. /media/disk
After that is done, you need to find out what the uuid of the new home
partition is:
sudo vol_id /dev/sdb1
that should reveal a string of alpha-numeric characters which are your
new UUID. it's best to copy with mouse to avoid typing errors.
Next you need to edit your fstab file
gksudo gedit /etc/fstab
Delete the line that refers to /dev/sdb1
create a new line in your fstab for home:
UUID=28107d44-f66e-4358-a2a3-a77be8002ce6 /home ext3 defaults 0 1
Note: don't copy the UUID I used above, it's the UUID for your root file
system,, be sure to paste the UUID copied from vol_id instead.
It's a very good idea to use UUID on a modern system with multiple hard
drives instead of /dev/sd[whatever]. The order of drives in /dev can
change depending on how the system is booted.
Save your changes to fstab and reboot, you should be done.
More information about the ubuntu-users
mailing list