Create new disk and file system on a Linux VM

Here are the steps to create a new disk and file system on Linux / Virtualbox

  • On the VirtualBox:   Go to Machine-->Settings-->Storage-->SATA Controller-->Add disk with 32GB (apps.vdi for example)
  • On the Linux server:   fdisk -l , the new disk /dev/sdb is presented.
  • fdisk /dev/sdb --> n (to add a new partition) -->to accept default, press Enter--> +16g (size ) -->p (to print partition table)-->w (write table to disk and exit)
  • partprobe /dev/sdb
  • cat /proc/partitions
  • mkfs -t ext 3 /dev/sdb1
  • e2label /dev/sdb1 /apps
  • vi /etc/fstab to add the label 
  • LABEL=/apps  /apps  ext3  defaults 1 2
  • mkdir /apps
  • mount /apps

Filesystem            Size  Used Avail Use% Mounted on
/dev/sdb1              32G  177M   30G   1% /apps

That's all..




No comments:

Post a Comment