On Thu, 12 Aug 2004 22:33, Olwen Williams wrote:
> My development webserver (old Pentium II with assortment of drives)
> which I stumbled along and set up a few months ago has a space problem.
>   Details below.  I think I need to put /home on /dev/hdc and don't know
> the process to set it up
Piece  of cake:-
The # characters are the root user prompts. You don't input them.

1) Become root user and bring the machine to single user mode
# su -
# telinit S

2) create partition /dev/hdc1
Use fdisk interactively to do this.
# fdisk /dev/hdc
Delete any existing partitions and then take the defaults for everything and 
it will fill the disk with one partition. fdisk is of French origin, so it's 
m (m'aidez) for help.

3) Create a file system on /dev/hdc1
# man mkfs.ext3
In particular to read up about the -c option flag and bad-blocks
# mkfs.ext3 [-c[c]] dev/hdc1                 # Assuming you'd like an ext3 
filesystem. There are many arguments as to which files system you should use.
Doubtless the list will entertain us long and hard, but ext3 is pretty good.

4) Mount /dev/hdc on a tempory mount point
# mkdir /mnt/tmp
# mount /dev/hdc1 /mnt/tmp

5) copy the whole of the /home area over to /mnt/tmp
# man cp   to read the manual page about copying recursively preserving all 
the file attributes.
# cp --archive /home /mnt/tmp

6) Unmount the new /home and do a filecheck on it.
# umount /dev/hdc1
# fsck.ext3 -f  /dev/hdc1

7) edit the file system table
#  $EDITOR /etc/fstab
change the device for the /home directory mount point.

8) unmount the partition comtaining the old /home 
# umount /dev/hdd3

9) mount the new home partition
# mount /dev/hdc1 /home

10) Go back into multi-user mode
# telinit 5

Finished.
Fully GPL Licenced. i.e. this is off the top of my head and untested, but I 
have done this 'more than once'. Others will I'm sure point out any error I 
might have made. If it breaks you keep all the pieces.

> Second problem is that I set it up with Redhat 9 because it recognised
> the network card (Mandrake had problems)
> I have FC2 Cds - am I likely to strike any problems?
No.

> Primary Master 1280 kb
> Primary Slave    CD-Rom
> Secondary Master   2112 kb
> Secondary Slave 4302 kb
>
> Running fdisk shows me I have:
> Disk /dev/hdc: 2111 MB, 2111864832 bytes
>
> Disk /dev/hdd: 4303 MB, 4303272960 bytes
> /dev/hdd1   *         1       407   3269196   83  Linux
> /dev/hdd2           408       455    385560   82  Linux swap
> /dev/hdd3           456       523    546210   83  Linux
>
> Disk /dev/hda: 1281 MB, 1281181696 bytes
> /dev/hda1   *         1        51    102784+  83  Linux
>
> df --a shows
> Filesystem           1K-blocks      Used Available Use% Mounted on
> /dev/hdd1             3217848   2190596    863796  72% /
> none                         0         0         0   -  /proc
> usbdevfs                     0         0         0   -  /proc/bus/usb
> /dev/hda1                99521     14318     80064  16% /boot
> none                         0         0         0   -  /dev/pts
> /dev/hdd3               537604    495652     14644  98% /home
> none                     95336         0     95336   0% /dev/shm

-- 
Sincerely etc.,
Christopher Sawtell

Reply via email to