(1)Open a terminal and su to root
(2)Use the command fdisk -l (lower case L) to view your partitions on your system, mine looks like this:
Code: Select all
Disk /dev/hda: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 1 3149 25294311 83 Linux
/dev/hda2 3150 4865 13783770 5 Extended
/dev/hda5 3150 3659 4096543+ 83 Linux
/dev/hda6 3660 4169 4096543+ 83 Linux
/dev/hda7 4170 4679 4096543+ 83 Linux
/dev/hda8 4680 4865 1494013+ 82 Linux swap / Solaris
(3)We need to find out if it is currently mounted and what file system it has so I use the command mount and get output that looks like this:
Code: Select all
deans:/home/user# mount
/dev/hda5 on / type jfs (rw,noatime,errors=remount-ro)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
procbususb on /proc/bus/usb type usbfs (rw)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
/dev/hda7 on /media/usbdisk-1 type ext3 (rw)
/dev/hda1 on /media/usbdisk type jfs (rw,noexec,nosuid,nodev,iocharset=utf8
*If your partition is not mounted then use mount /dev/hda7 /mnt (adjust for your partition) to mount it at /mnt. Then repeat step 3 to verify it is mounted and where it is mounted and the filesystem type.
(4)do the following commands
cp -a /home/* /media/usbdisk-1
This will copy your user folders from home to the new partition. Adjust /media/usbdisk-1 to whatever your partition mount point was in step 3.
umount /media/usbdisk-1
This unmounts the partition so we can remount it later at /home instead. Adjust /media/usbdisk-1 to whatever your partition mount point was in step 3.
mv /home /oldhome
This moves (renames) our home folder to oldhome as a backup just in case.
mkdir /home
This makes a new blank home folder to mount our partition with.
mount /dev/hda7 /home
This mounts our spare partition at /home. Adjust /dev/hda7 for the partition you want to use as home.
Now if you use the mount command you should see something like this:
Code: Select all
deans:/home/user# mount
/dev/hda5 on / type jfs (rw,noatime,errors=remount-ro)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
procbususb on /proc/bus/usb type usbfs (rw)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
/dev/hda7 on /home type ext3 (rw)
/dev/hda1 on /media/usbdisk type jfs (rw,noexec,nosuid,nodev,iocharset=utf8)
(5)Now we need to *carefully* edit our /etc/fstab file and add a line so that it knows to mount our partition as /home at boot time.
cp /etc/fstab /etc/fstab_BKUP
makes a backup of our /etc/fstab file just in case
nano /etc/fstab
to open the file in nano
My fstab originally looks like:
Code: Select all
# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
/dev/hda5 / jfs noatime,errors=remount-ro 0 1
/dev/hda8 none swap sw 0 0
Code: Select all
/dev/hda7 /home ext3 defaults 1 2
So now my /etc/fstab looks like:
Code: Select all
# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
/dev/hda5 / jfs noatime,errors=remount-ro 0 1
/dev/hda8 none swap sw 0 0
/dev/hda7 /home ext3 defaults 1 2