Adding an extra disk to Linux
Q I have a Linux PC, running Red Hat 9.2. I want to add an additional disk drive. I know this sounds like the most basic of tasks, but having only done this with Windows, I don't really know what to expect. After I've added the hardware and rebooted, what do I do next? I assume that I need to format the drive but where would I complete this task? Am I right in thinking that Linux will automatically recognise the addition of the drive? Will I see it as an additional drive or just continuous disk space? Any clues that you could give me would be a real help.
A When adding an extra disk to Linux, you'll have to partition it using fdisk and then build filesystems on the partitions you create. Once created, you can mount them in the appropriate location and use them. To maintain a mount across a reboot, adding an entry to /etc/fstab for the new filesystem will ensure that it's mounted in the correct location when the system comes back up. If your new disk is hdc, you can do:
mke2fs -j /dev/hdc1
mount /dev/hdc /home2
You could also copy the contents of /home onto /home2 using 'cp -fra /home/* /home2' once it's mounted, then modify /etc/fstab to mount /dev/ hdc1 onto /home at boot time.
Follow us on Identi.ca or Twitter