1

I tried this

xargs -p 5 -n1 mke2fs -t ext4 /dev/sd[d-p]1

and got this

[/dev/mapper]# seq 1 15 | xargs -p 5 -n 1 mke2fs -t ext4 /dev/sd[b-p]1 5 -n 1 mke2fs -t ext4 /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1 /dev/sdf1 /dev/sdg1 /dev/sdh1 /dev/sdi1 /dev/sdj1 /dev/sdk1 /dev/sdl1 /dev/sdm1 /dev/sdn1 /dev/sdo1 /dev/sdp1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ?...

Also tried this

[/dev/mapper]# xargs -p 5 -n 1 mke2fs -t ext4 /dev/sd[b-p]1

and got nothing. Any ideas? what ami doing swo

2
  • 1
    That puts a heavy I/O load, and doing it in parallel doesn't make any sense unless they are connected to separate controllers Commented Jan 15, 2016 at 16:24
  • @vonbrand Are you sure? If the disks are slow SATA disks, then I would imagine most time was spent waiting for the platter to spin/seeking. Have you tested your claim? If so would you share the numbers with us? Commented Jan 18, 2016 at 2:31

2 Answers 2

1

Using GNU Parallel you would do this:

parallel -P 5 mke2fs -t ext4 ::: /dev/sd[d-p]1
0

Try this:

 echo -e "/dev/sdb\n/dev/sdc\n/dev/sdd" | xargs -P0 -n1  mkfs.ext4
1
  • xargs delimits by blank spaces by default, so you don't need the \n there at all. Commented Jan 17, 2016 at 18:29

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.