MySQL for the Internet of Things

(Steven Felgate) #1
Chapter 6 ■ Building low-Cost MysQl data nodes

Create a new label
g create a new empty GPT partition table
G create a new empty SGI (IRIX) partition table
o create a new empty DOS partition table
s create a new empty Sun partition table


Command (m for help): p
Disk /dev/sda: 111.8 GiB, 120034123776 bytes, 234441648 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 790E7C68-F089-45C7-A9E9-D7C2CA56BB31


Command (m for help): n
Partition number (1-128, default 1): 1
First sector (34-234441614, default 2048):
Last sector, +sectors or +size{K,M,G,T,P} (2048-234441614, default 234441614):


Created a new partition 1 of type 'Linux filesystem' and of size 111.8 GiB.


Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.


There are a number of things going on here. I’ve highlighted the steps in bold. Notice first I show
the help menu for the utility with the m command per the prompt. Next, I use the p command to print the
partition table verifying that there is no partition there. If you had partitions defined and wanted to delete
them, you’d use the d command to do so.


■Caution if you have a partition on your drive that has data you want to keep, abort now and copy the data


to another drive first. the following steps erase all data on the drive!


You then create a new partition using the command n and accept the defaults to use all the free space.
To check your work, you can use the p command to print the device partition table and metadata. It shows
(and confirms) the new partition.
If you are worried that you may have made a mistake, do not panic! The great thing about fdisk is that
it doesn’t write or change the disk until you tell it to with the w or write command. In the example, you issue
the w command to write the partition table. To see a full list of the commands available, you can use the h
command or run man fdisk.


■Tip For all linux commands, you can view the manual file by using the command man .

Free download pdf