What your block devices look like before mapping:
ubuntu@cpu:~$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
xvda 202:0 0 100G 0 disk
└─xvda1 202:1 0 100G 0 part /
ubuntu@cpu:~$
Under the instance configuration section, click on advanced and add the following to Block device mapping
:
/dev/sdf/=:100
This assumes we are mounting sdf to the device /dev/xdvf and setting the drive size to 100G
Add the following to the user-data section in the jenkins ec2-plugin section of the instance:
#!/bin/bash
mkfs -t ext4 /dev/xvdf && mkdir /jenkins && mount /dev/xvdf /jenkins
chown -R ubuntu.ubuntu /jenkins
Set Remote FS root
to /jenkins
Save the configuration and run a job uses this node. Create a test job to show the output of lsblk example output from my job:
root@cpu:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
xvda 202:0 0 100G 0 disk
└─xvda1 202:1 0 100G 0 part /
xvdf 202:80 0 100G 0 disk /jenkins