how to write a simple format reutine for customized filesystem!

Submitted by M_ALI
on October 13, 2005 - 2:37am

HI
i am trying to write a simple program for formating a hard disk or disk drive for a simple filesystem from where i can get good help related to source code!
thank you in advance for help!

Assuming this is a userspace

T. (not verified)
on
October 19, 2005 - 1:23pm

Assuming this is a userspace program (you shouldn't be formatting partitions from kernelspace, anyway...), you just have to open() the partition via its device special file (e.g. /dev/hda1) and write() away. You'll likely also need ioctl() to do stuff such as determining the disk geometry. Manpages are your friends.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.