blockdev.formatted on entire device is not working

94 views
Skip to first unread message

Daniel Hafner

unread,
Jan 15, 2016, 3:59:42 AM1/15/16
to Salt-users
Hey there,
i'm tried to create a ext4 fs on a block device which is not partitioned, but this will not work:

here the state:
/dev/sdb:
 blockdev.formatted:
   - fs_type: ext4

here the output:
vsvdeploy_test03:
----------
         ID: /dev/sdb
   Function: blockdev.formatted
     Result: False
    Comment: Failed to format /dev/sdb
    Started: 09:48:27.500593
   Duration: 30205.33 ms
    Changes:    

Summary for vsvdeploy_test03                                                                                     
------------                                                                                                                          
Succeeded: 0
Failed:    1
------------
Total states run:     1                                                                                                               
Total run time:  30.205 s



If i'm doing the same on a partition it works:
/dev/sdb1
 blockdev.formatted:
   - fs_type: ext4


here the output:
vsvdeploy_test03:
----------
         ID: /dev/sdb1
   Function: blockdev.formatted
     Result: True
    Comment: /dev/sdb1 has been formatted with ext4
    Started: 09:50:00.947543
   Duration: 648.305 ms
    Changes:    
             ----------                                                                                                              
             new:
                 ext4
             old:
                 ext4

Summary for vsvdeploy_test03                                                                                     
------------                                                                                                                          
Succeeded: 1 (changed=1)
Failed:    0
------------
Total states run:     1                                                                                                               
Total run time: 648.305 ms

Is there a way - quite apart from cmd.run - to implement this?

Thy
Daniel

Colton Myers

unread,
Jan 25, 2016, 5:26:51 PM1/25/16
to salt-...@googlegroups.com
I would check the debug logs on the minion during the state run to see if there's any more information on why the format failed.

--
Colton Myers
Core Engineer, SaltStack
@basepi on Twitter/Github/IRC

Registration for SaltConf 2016 is open! http://saltconf.com/register/

--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Michael Beer

unread,
Feb 8, 2016, 9:03:56 AM2/8/16
to Salt-users
Hi,

i've got the same problem. This is my log that i get from the salt-minion.

[INFO    ] Executing command 'mkfs -t ext4 /dev/sdc' in directory '/root'
Feb 08 13:56:59 bench1 salt-minion[13659]: [ERROR   ] Command 'mkfs -t ext4 /dev/sdc' failed with return code: 1
Feb 08 13:56:59 bench1 salt-minion[13659]: [ERROR   ] output: mke2fs 1.42.9 (28-Dec-2013)
Feb 08 13:56:59 bench1 salt-minion[13659]: /dev/sdc is entire device, not just one partition!
Feb 08 13:56:59 bench1 salt-minion[13659]: Proceed anyway? (y,n)
Feb 08 13:56:59 bench1 salt-minion[13659]: [INFO    ] Check blk fstype attempt 1 of 10
Feb 08 13:56:59 bench1 salt-minion[13659]: [INFO    ] Executing command 'lsblk -o fstype /dev/sdc' in directory '/root

Is there any flag available which forces the salt-minion to proceed the formatting of the device?

Regards,
Michael

Colton Myers

unread,
Feb 8, 2016, 1:46:36 PM2/8/16
to salt-...@googlegroups.com
Sounds like something we need to add. Please file an issue on Github.

--
Colton Myers

--
Reply all
Reply to author
Forward
0 new messages