Create ext4 partition for content

1,009 views
Skip to first unread message

Dan Byström

unread,
Jul 14, 2014, 12:33:06 PM7/14/14
to coreo...@googlegroups.com
I've installed CoreOS using iPXE, next I want to create a ext4 partiton for docker my Postgresql volumes. Not sure how to edit/manage partition in CoreOS. Can cloud-config help me configure my partitions? Thanks /Dan

Christopher Armstrong

unread,
Jul 14, 2014, 3:58:48 PM7/14/14
to coreo...@googlegroups.com
You can define typical systemd units in your cloud-config file, so you could simply create a Type=oneshot systemd service which does what you need it to.

Darren Shepherd

unread,
Jul 14, 2014, 10:28:27 PM7/14/14
to coreo...@googlegroups.com
Here's an example of how to format and mount the ephemeral drive in EC2.  http://coreos.com/docs/cluster-management/setup/mounting-storage/

  You can use that as an example.  Just be careful  because if you directly copy that it will format on every boot.  You probably just want to format manually once and only use the mount unit.  

Darren

Rob Szumski

unread,
Jul 15, 2014, 12:52:05 AM7/15/14
to coreo...@googlegroups.com
You can touch a file to give your units an indication that formatting has already been performed. Combined with ConditionPathExists=!/etc/%m.format means that the unit won’t run if that file is present. These concepts are present in this (incomplete, unfinished) gist for setting up some disks: https://gist.github.com/pquerna/5c198acd851a1a76eba4

Dan Byström

unread,
Jul 15, 2014, 6:19:56 AM7/15/14
to coreo...@googlegroups.com
Seems like btrfs and ext4 partitioning is beyond my skills :(

CoreOS installation formats my drive and create a big btrfs partition? Running Postgresql my machine I want my drive to be 50% btrfs, 50% ext4? Reviewing Darren's and Rob's examples there is no information how to split the btrfs and ext4 partitions to specific sizes. Is it assumed that I have attached a second drive to my machine?

Right now I'm playing around on Vultr VPS machines, don't think it's possible add a second drive to my machine.

Mauricio Tavares

unread,
Jul 15, 2014, 3:46:07 PM7/15/14
to coreo...@googlegroups.com


On Tuesday, July 15, 2014 6:19:56 AM UTC-4, Dan Byström wrote:
Seems like btrfs and ext4 partitioning is beyond my skills :(

CoreOS installation formats my drive and create a big btrfs partition? Running Postgresql my machine I want my drive to be 50% btrfs, 50% ext4? Reviewing Darren's and Rob's examples there is no information how to split the btrfs and ext4 partitions to specific sizes. Is it assumed that I have attached a second drive to my machine?

      I really suck as systemd (just see my postings here if you want to have  alaugh at my expense), but I *think* this is where you want to do some massaging:

/bin/yes | mdadm --create --verbose -f /dev/md0 --level=stripe --raid-devices=2 ${BLOCKS}
mkfs.ext4 /dev/md0
touch /etc/${MACHINE_ID}.raid-setup

Look at the line

mkfs.ext4 /dev/md0

What it seems to saying is to grab the entire raid you created (/dev/md0) and then making it ext4. So, you need to then partition it; does it have parted? If not, what does it use to partition the disk? Anywhoo, I would have the disk partition just before this line, which would be replaced with

mkfs.ext4 /dev/md0.1
mkfs.ext4 /dev/md0.2




[Mount]
What=/dev/md0
Where=/media/data
Type=ext4

 

Mauricio Tavares

unread,
Jul 15, 2014, 3:47:58 PM7/15/14
to coreo...@googlegroups.com
Sorry, the really helpful google group interface decided to blank all I was typing.


On Tuesday, July 15, 2014 3:46:07 PM UTC-4, Mauricio Tavares wrote:


On Tuesday, July 15, 2014 6:19:56 AM UTC-4, Dan Byström wrote:
Seems like btrfs and ext4 partitioning is beyond my skills :(

CoreOS installation formats my drive and create a big btrfs partition? Running Postgresql my machine I want my drive to be 50% btrfs, 50% ext4? Reviewing Darren's and Rob's examples there is no information how to split the btrfs and ext4 partitions to specific sizes. Is it assumed that I have attached a second drive to my machine?

      I really suck as systemd (just see my postings here if you want to have  alaugh at my expense), but I *think* this is where you want to do some massaging:

/bin/yes | mdadm --create --verbose -f /dev/md0 --level=stripe --raid-devices=2 ${BLOCKS}
mkfs.ext4 /dev/md0
touch /etc/${MACHINE_ID}.raid-setup

Look at the line

mkfs.ext4 /dev/md0

What it seems to saying is to grab the entire raid you created (/dev/md0) and then making it ext4. So, you need to then partition it; does it have parted? If not, what does it use to partition the disk? Anywhoo, I would have the disk partition just before this line, which would be replaced with

mkfs.ext4 /dev/md0.1
mkfs.brtfs /dev/md0.2


      And then redo the mount statement,

[Mount]
What=/dev/md0
Where=/media/data
Type=ext4

  as needed.
Reply all
Reply to author
Forward
0 new messages