Phone sales support +39 0575 05077
  Phone technical support +39 0575 0508
 
Computing > 3 - Creating and Configuring a Cloud Server > How to re-partition and format a hard drive to which space has been added (Linux)

3.09.2 How to re-partition and format a hard drive to which space has been added (Linux) Cloud Server Pro service guide

With the exception of the first hard disk (HD) present in the Cloud Server, the additional ones (HD1, HD2, HD3) are supplied RAW: it is necessary to partition and format the RAW space to be able to use it in the Operating System.

(parted) print
Model: VMware Virtual disk (scsi)
Disk /dev/sdb: 21.5GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type     File system  Flags
 1      1049kB  525MB   524MB   primary  ext4         boot
 2      525MB   8590MB  8065MB  primary               lvm

(parted) mkpart
Partition type?  primary/extended? primary
File system type?  [ext2]? ext3
Start? 8590MB
End? 21.5GB

(parted) print
Model: VMware Virtual disk (scsi)
Disk /dev/sda: 21.5GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type     File system  Flags
 1      1049kB  525MB   524MB   primary  ext4         boot
 2      525MB   8590MB  8065MB  primary               lvm
 3      8590MB  21.5GB  12.9GB  primary

# mke2fs /dev/sda3
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
786432 inodes, 3145728 blocks
157286 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=3221225472
96 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208

Writing inode tables: done
Writing superblocks and filesystem accounting information: done

  1. Accessing the Cloud Server via SSH.
  2. Once you have accessed it, type fdisk -l from the command line and press enter.
  3. The information will then be displayed on the disks installed and their partitions.
  4. Identify the disk to which the space has been added and check the number of partitions already present.
  5. Run the Parted utility from the command line for the disk on which the space was added, by keying in parted /dev/sda/ (in the example the unit to be configured is the /dev/sda) and by pressing the Enter key.
  6. If the disk on which you added the space has never been formatted before, first you need to create the partition table with the mktable command and selecting  the Msdos option, otherwise ignore this step and proceed to the next step.
  7. Type print and press enter to make sure that all partitions are already present in the disk.
  8. To create a new partition for the space added, launch mkpart and respond to the various prompts. First you are asked to choose the "type" between "primary" and "extended" (we will choose primary) then you are asked for the type of "File System" (for example we choose "ext3" and confirm); then you will be asked for the start and the end of the partition (in our example, if we want to create a partition that corresponds with the added space, simply indicate as the start the "end" value of the partition with the highest number and with the maximum size for the end).
  9. At this point by re-launching print we can check that you have created the new partition 3.
  10. Now you just have to create the Filesystem in the partition created: first exit "parted" by typing quit and then launch mke2fs for the partition created.
 The operations described have an exclusively exemplary nature: the improper use or use without due care and skill, can cause the partial and/or total loss of data, and in some cases may disrupt the correct operation of the virtual machine. Using this guide without the appropriate skills is not recommended. Aruba S.p.A. does not accept any responsibility for any problems or damage caused by using these guides.



Bookmark and Share