3

I am new to Ubuntu and have a quesion:

I have Ubuntu 16.04 running on VMware. My initial setup had one disk. I added another 2 disk (one 2GB and one 1GB). Now I want to add them to the Ubuntu, how can I do that? First I know I should format them but when I want run fdisk command I get this error:

Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0xd5a1dff9.

Command (m for help):

And here is my disk info:

  *-disk:0                
       description: SCSI Disk
       physical id: 0.0.0
       bus info: scsi@32:0.0.0
       logical name: /dev/sda
       size: 10GiB (10GB)
       capabilities: partitioned partitioned:dos
       configuration: logicalsectorsize=512 sectorsize=512 signature=bcc12dac
  *-disk:1
       description: SCSI Disk
       physical id: 0.1.0
       bus info: scsi@32:0.1.0
       logical name: /dev/sdb
       size: 1GiB (1073MB)
       configuration: logicalsectorsize=512 sectorsize=512
  *-disk:2
       description: SCSI Disk
       physical id: 0.2.0
       bus info: scsi@32:0.2.0
       logical name: /dev/sdc
       size: 2GiB (2147MB)
       configuration: logicalsectorsize=512 sectorsize=512
  *-cdrom
       description: DVD-RAM writer
       physical id: 0.0.0
       bus info: scsi@3:0.0.0
       logical name: /dev/cdrom
       logical name: /dev/cdrw
       logical name: /dev/dvd
       logical name: /dev/sr0
       capabilities: audio cd-r cd-rw dvd dvd-r dvd-ram
       configuration: status=open

My question is how to solve this issue using command only?

Amin
  • 91

1 Answers1

5

1.format /dev/sdb

fdisk /dev/sdb
enter: n
enter: p ( primary )
enter: default -> press enter
enter: default-> press enter

enter:w ( write ) to save the changes 

if you type fdisk -l : you should see a /dev/sdb1

Now make a ext4 filesystem on it with: mkfs.ext4 /dev/sdb1 Create the domain you wish to mount it like /db with mkdir /db Mount it: mount /dev/sbd1 /db To mount after reboot you need to add this in the fstab similar to / You need to get the UID of the partition with: blkid These UID you need to add in the new line you have added in /etc/fstab.

For the second disk you do it in the same way

Alpy
  • 565
  • Older versions of fdisk, do not support the newer gpt partitioning. Often better to use gpt if system is UEFI or less than 5 years old. You do not partition drive like sdb, but partition drive first then format partition(s). If you want gpt, you can use gdisk or parted. Or fdisk from 18.04. http://www.rodsbooks.com/gdisk/ – oldfred Feb 23 '19 at 18:17