Can Linux systems add new partitions? How to increase

  

When we install Microsoft system, we sometimes add a new partition to our system or server, but if you install a Linux system, can you add a new partition? What kind of operation can be achieved? The second time is through remote operation, which seems a bit unimaginable on windows, linux is good, everything can be operated remotely. After adding a new hard disk in the computer room, I started to add a new partition through ssh login.

This time we mainly want to move the previous sdc1/home partition to the newly added hard disk. Sdc we checked out through the badblocks command, and after several attempts to repair, it failed, so we decided to replace the problematic hard drive with a new one. The new hard disk is sdb, first partition first; fdisk/dev/sdb if there is a partition before, it is best to use the d command to delete and then use the n command to add a new partition. This should be very inconvenient, I think I don't need to introduce it. If you want to add a swap partition, remember that the partition code is 82 instead of the default linux code 83. Remember to save the exit w command, you must save it. Ok, the partition is of course formatted, mkfs.ext3-c/dev/sdb1.

Note that I used the -c option to check the hard disk in the "read-only" mode. This command will check the hard disk when formatting the hard disk and mark the wrong hard disk <block”. Formatting the hard disk in this way requires considerable patience, because after the command is run, the hard disk will be checked one by one. After the format, I think it is necessary to check if your new hard drive has bad sectors, which may be scared by bad sectors. Badblocks-b4096-c16/dev/sdb1-osdb1-badblocks-list“-cnumberofblocks” is the number of checks, the default is 16 times. Such commands require patience. Among them, “badblocks” with a block of 4096, each block is checked 16 times, and the result is output to the "sdb1-badblocks-list" file.

If the hard disk is normal, sdb1-badblocks-list should have no content, and there are bad sectors. After finishing the area, the formatting is good, and the check is no problem. The final step is to modify the /etc/fsatb file. It is very simple to change the partition corresponding to the previous home to the current partition. Of course, if there is data transfer. Please transfer in advance. Here is my setting for the new hard disk partition /dev/sdb1/homeext3defaults12.

If you are installing a Linux system or a server, you want to add partitions but you can't implement them. Now the methods are all above, maybe This question is more professional. If you have a rookie, then it is best to fake it. I hope to help you.

Copyright © Windows knowledge All Rights Reserved