COMPUTING > Cloud Servers > Creating and configuring a Cloud Server > Partitioning and formatting an added hard drive

3.2.5.2 Partitioning and formatting an added hard drive Cloud Server Pro service guide

Choose the operating system of the hard disk and proceed as indicated below:
 
  1. Access the Cloud Server via RDP.
  2. To access Disk Management go to "Start", then click with the right mouse button on "Computer" ("My Computer" in Windows 2003) and select "Manage".
  3. Select "Disk Management" under "Storage" in the left column.
  4. Right click on the mouse button on the icon of the disk you just added and select "Online" (fig.1).
  5. Right click on the mouse button again on the same icon and select "Inizialize disk" (fig.2).
  6. Right click on the mouse button on the "unallocated" disk space and select for example "New Simple Volume" by following the steps indicated (choice of the size of the partition and letter allocation, file system type) (fig.3).
  7. Once this procedure is complete, the disk will be partitioned and ready for formatting (fig.4).
part-form-win-01-(1).jpg
[fig.1]


[fig.2]


[fig.3]


[fig.4]

Repeat the procedure from step 5 if you want to create several partitions in the same hard disk.

(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

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

(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 21.5GB  21.5GB  primary ext3

# mkfs.ext3 /dev/sdb1
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
655360 inodes, 2621184 blocks
131059 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2684354560
80 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

Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 39 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.

# /etc/fstab
# Created by anaconda on Mon May 21 09:51:28 2012
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info

/dev/mapper/vg-lv_root  /             ext4     defaults        1 1
UUID=880645ef-dfff-477d-92d3-886935289a74 /boot         ext4     defaults        1 2
/dev/mapper/vg-lv_swap  swap          swap     defaults        0 0
tmpfs                   /dev/shm      tmpfs    defaults        0 0
devpts                  /dev/pts      devpts   gid=5,mode=620  0 0
sysfs                   /sys          sysfs    defaults        0 0
proc                    /proc         proc     defaults        0 0
/dev/cdrom              /media/cdrom  iso9660  noauto,owner,ro 0 0
/dev/sdb1               /backup       ext3     defaults        1 1

  1. Access 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. To identify the disk you have just added: it is usually located in the form /dev/sdb if it is the first disk added.
  5. Run the Parted utility from the command line for the disk that you wish to format: for example parted /dev/sdb and confirm by pressing the Enter key.
  6. Then you need to create a partition table by keying in the command mktable and pressing the Enter key. When asked what type of partition, type in Msdos and confirm by pressing the Enter key.
  7. Type print press enter to make sure that it will actually be in the new disk. In this case the type of model will be displayed, the maximum size will be shown and the partitions will be listed (in this case no partition as the disk has just been added).
  8. To create a new partition launch mkpart and respond to the various requests. 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 physical size of the disk simply indicate the start with 1 and the end with 21.5 GB).
  9. At this point by re-launching print we can check whether the new partition 1 has been created.
  10. Now you just have to create the Filesystem in the created partition: first exit "parted" by typing quit and then launch mke2fs for the created partition (which in the example is: /dev/sdb1).
  11. To manage the information on a partition to mount it is possible to edit file /etc/fstab.

Disk /dev/sdb: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        2610    20964793+  82  Linux swap / Solaris

# mkfs.ext3 /dev/sdb1
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
655360 inodes, 2621184 blocks
131059 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2684354560
80 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

Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 39 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.

# /etc/fstab
# Created by anaconda on Mon May 21 09:51:28 2012
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info

/dev/mapper/vg-lv_root  /             ext4     defaults        1 1
UUID=880645ef-dfff-477d-92d3-886935289a74 /boot         ext4     defaults        1 2
/dev/mapper/vg-lv_swap  swap          swap     defaults        0 0
tmpfs                   /dev/shm      tmpfs    defaults        0 0
devpts                  /dev/pts      devpts   gid=5,mode=620  0 0
sysfs                   /sys          sysfs    defaults        0 0
proc                    /proc         proc     defaults        0 0
/dev/cdrom              /media/cdrom  iso9660  noauto,owner,ro 0 0
/dev/sdb1               /backup       ext3     defaults        1 1

  1. Access the Cloud Server via SSH or via Applet Java.
  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. To identify the disk you have just added: it is usually located in the form /dev/sdb if it is the first disk added. If the disk you just added does not appear on the list you will probably need to reboot the virtual machine: type reboot and confirm; once you have restarted the Cloud Server repeat the operations from point 1.
  5. Launch the utility CFdisk from the command line indicating the disk you want to partition by typing for examplecfdisk /dev/sdb and pressing enter (in this example the disk you want to partition is dev/sdb/).
  6. A screen will appear with the disk's features: at this point move with the arrows to the command [New] and press enter.

    cfdisk-1.jpg

    You will be asked to choose between the first two options [Primary] and [Logical] the new partition: select for example [Primary] and confirm.

    cfdisk-2.jpg

    Then you will be asked to choose the size of the partition (if the number suggested is left unchanged a partition will be created for all the new disk space) and confirm. The new partition will then be created, and listed in the main screen under the name sdb1 in our example.

    cfdisk-3.jpg

    At this point by still moving with the arrow keys and selecting [Type] you can choose the Filesystem on the partition created: you will be offered a list of Filesystem types, then type the code corresponding to the type chosen and confirm by pressing Enter. The initial screen will be updated with the choice type for the partition created.
  7. From the main screen by selecting [Write] you can format the partition created: you will be asked for confirmation to continue with the operation; after a few moments the operation will be completed and you will be redirected to the main screen.
  8. To exit move to [quit] and to check, by re-typing fdisk -l can also see the new partition created in the list of disks.
  9. Now all that's left to do is create the Filesystem in the created partition: first of all exit from parted by typing quit and then if you wish to create an ext3 partition launch the mkfs.ext.3 command for the created partition (which in the example is /dev/sdb1).
  10. To manage the information on a partition to mount it is possible to edit file /etc/fstab.
 
The operations described are examples: the improper use or use without due care and skill, can cause the partial and total loss of data, and in some cases may jeopardize the correct operation of the virtual server. 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