How to remotely add new partition for the Linux server



In a new Linux server to install a new partition, is very simple and can telnet to complete all the operations, of course, to achieve added before, make sure the server has been added to the physical hard drive good.

The operation is by remote operation, and this is where Linux easily than Windows, because windows on the partition seems a bit unthinkable, but what can linux remote operation. After adding a new hard drive, we can start a remote login via ssh to add a new partition. The main purpose of adding a new hard drive is trying to previous / home partition, moved to a new hard drive add up. sdc badblocks command by checking out our many bad sectors, but after several repair attempts, ended in failure, so he decided to use the new hard drive for this problem. The new drive is sdb, the first partition first;

fdisk / dev / sdb

If you previously had partitions, it is best to remove and then use the d command with the n command to add a new partition. If you want to add a swap partition, then remember that area code is 82, instead of the default linux code 83. Be sure to use w command to save out.

After the course is formatted partition:

mkfs.ext3-c / dev/sdb1

Note that I used the-c option with the "read-only" way of checking the hard disk. This command will check the hard drive formatted hard disk, and marked the wrong disk "block".

By the way, are so nervous every time restart the machine for fear of modified fstab, the system failed to start. Use this method to format the hard disk, required considerable patience, as the command runs, it will use a one way check the hard drive read. Formatting is complete, I feel the need to check whether your new hard disk bad sectors, may be bad sectors owes something to get afraid.