Win a copy of Pragmatic AI this week in the Artificial Intelligence forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Formatting drive with java.  RSS feed

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm running java on a ubuntu server, is there a way I can have java format a disk drive(/dev/sd*) to ext3?
 
Sheriff
Posts: 21426
94
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use ProcessBuilder and Process to call an external command. See http://www.redhat.com/docs/manuals/linux/RHL-7.3-Manual/ref-guide/s1-filesystem-ext3-create.html
And while you're at it, read the Javaworld article "When Runtime.exec() won't".
 
Bartender
Posts: 1847
46
Eclipse IDE Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
using java for systems programming is a bad idea,

In simple words, java cant do it, It can invoke another program to do it as Rob Prime said,
But if you think that java can write "0" and "1" to the disk directly and do the formatting work, you are mistaken.

Since you mention server,
what is your aim?
- is it to remotely send a command to this server that triggers a partition format ?
- is it to format itself after some timely schedule ?

both the above options can be solved by using the underlying OS: Ubuntu
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!