1829646 Members
9696 Online
109992 Solutions
New Discussion

Format File system.

 
SOLVED
Go to solution
gigiz
Valued Contributor

Format File system.

Hallo !!!
I would want to know if is it possible "TO FORMAT at LOW LIVELL a FILE SYSTEM" and which is the command
21 REPLIES 21
Ivan Ferreira
Honored Contributor

Re: Format File system.

LOW LEVEL? What are you trying to do, you can zero a block device using dd if=/dev/zero and then re-create the file system.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Senthil Kumar .A_1
Honored Contributor

Re: Format File system.

Hi,

It should be possible with the command, mediainit.

But, the usage is highly discouraged because,nowadays, all known disks are Low level formatted at the factory itself. Please remember it gets more complicated than olden days because, you are bound to have more sectors per track as you move from inner to outer cylinders.

Regards,
Senthil Kumar .A
Let your effort be such, the very words to define it, by a layman - would sound like a "POETRY" ;)
James R. Ferguson
Acclaimed Contributor

Re: Format File system.

Hi:

If by "format" you mean destroy and initialize, then use 'newfs'. See the manpages for more information.

Regards!

...JRF...
A. Clay Stephenson
Acclaimed Contributor

Re: Format File system.

Note the the terms "low level format" and "filesystem" are mutually exclusive terms. There is no need to run mediainit on any drives under HP-UX. It would help if you better explained what you are hoping to achieve.
If it ain't broke, I can fix that.
Senthil Kumar .A_1
Honored Contributor
Solution

Re: Format File system.

Hi again,

mediainit is used for low level formatting of DISKs, tape etc.. not the Filesystem. I do not understand, what the word FILESYSTEM is doing, if you are interested in lowlevel formatting.

Please be aware that low level formating means, creating sectors and tracks and has nothing to do with filesystem.

If you are talking about formating filesystem ,then ... mkfs,newfs are the ones you are looking for.

Regards,
Senthil Kumar .A
Let your effort be such, the very words to define it, by a layman - would sound like a "POETRY" ;)
gigiz
Valued Contributor

Re: Format File system.

Ok
They have asked me to make one script to format at low level ...
I have thought next to the commando newfs someone I have spoken to me about a script that writes all zero ...
Sincerely I do not know if it is better to use newfs or other procedures as that one of the zero.
Someone know to give a council to me?
Senthil Kumar .A_1
Honored Contributor

Re: Format File system.

Hi,

The better option is "dd"

dd if=/dev/zero of=/dev/rdsk/c#t#d# bs=1024000

NOTE: please understand what you are doing..

Do not use mediainit, it is not recommended.

Regards,
Senthil Kumar .A
Let your effort be such, the very words to define it, by a layman - would sound like a "POETRY" ;)
Senthil Kumar .A_1
Honored Contributor

Re: Format File system.

By the way Gigiz,

do you want to blank out the disk or create a filesystem. Please be clear in your query.Please understand the dd in my previous post blanks out the disk not...

Regards,
Senthil Kumar .A
Let your effort be such, the very words to define it, by a layman - would sound like a "POETRY" ;)
Pete Randall
Outstanding Contributor

Re: Format File system.

Typically the use of /dev/zero to write zeros is done at the physical volume level for security reasons when a system is about to be transferred (sold/donated) to an outside party. This is what would be called "low level". You can also run mediainit but, once again, this is done against a whole physical disk.

If you truly mean to null out a single file system, which, by the way, could occupy part of a disk or several disks, then the method of choice would be to run the newfs command.


Pete

Pete
A. Clay Stephenson
Acclaimed Contributor

Re: Format File system.

If you need to erase (actually overwrite) all data on the disk for security concerns then multiple runs of dd writing random data should be your approach. If all you want to do is make the disk/LUN/LVOL available for use again as a filesystem then the newfs command is quite sufficient.
If it ain't broke, I can fix that.
gigiz
Valued Contributor

Re: Format File system.

I want to format a file system that it can be on more of one disk ....
A. Clay Stephenson
Acclaimed Contributor

Re: Format File system.

Do you want to create more than one filesystem on the same disk OR do you want to allow a filesystem to extend over more than 1 disk? In any event, the answer is the same -- the Logical Volume Manager (LVM)
or the Veritas Volume Manager (VxVM) if you have it installed.

The idea is that you use pvcreate to prepare the disk(s) for use under LVM. You then create a volume group (VG) using vgcreate. Next, ig you need to add more disks, you use vgextend. You use lvcreate to create Logical Volumes (LVOL's) and finally newfs is used to create the filesystems on each LVOL.

Man pvcreate, vgcreate, vgextend, lvcreate, and newfs_vxfs for details.
If it ain't broke, I can fix that.
Senthil Kumar .A_1
Honored Contributor

Re: Format File system.

could you rephrase the question again gigiz,
Hard to make out what you are trying to convey.
Let your effort be such, the very words to define it, by a layman - would sound like a "POETRY" ;)
Senthil Kumar .A_1
Honored Contributor

Re: Format File system.

potreste formulare nuovamente ancora il gigiz di domanda, duro fare fuori che cosa state provando a trasportare.
Let your effort be such, the very words to define it, by a layman - would sound like a "POETRY" ;)
James R. Ferguson
Acclaimed Contributor

Re: Format File system.

Hi:

You should probably read chapter-6 of the "Managing Systems and Workgroups: A Guide for HP-UX System Administrators" guide:

http://docs.hp.com/en/B2355-90950/B2355-90950.pdf

This chapter will provide you with a better understanding of disks and filesystems.

Regards!

...JRF...
gigiz
Valued Contributor

Re: Format File system.

I know very well LVM
I don't want to extend or create a logical volume or file system, I WANT say if may be format a FILE SYSTEM, and which is the better commando in order to make it ?
James R. Ferguson
Acclaimed Contributor

Re: Format File system.

Hi:

You already have your answer. Use 'newfs' or write zeros with 'dd' to the raw device.

Define "better". If security is your objective, then pour acid on the disk and beat it with a sledgehammer. Afterwards, place the pieces it in a large magnetic field.

Regards!

...JRF...
Senthil Kumar .A_1
Honored Contributor

Re: Format File system.

Hi James,

Your informal comment on technical term "Degauzzing" has left me Laughing. This is the first ITRC thread which has done this. A nice and cute phrase to use it for my customer in future.

:))

Regards,
Senthil Kumar .A
Let your effort be such, the very words to define it, by a layman - would sound like a "POETRY" ;)
gigiz
Valued Contributor

Re: Format File system.

ferguson me memories the trainer of manchester the whose career e' on the way of the sunset

:-)
Smile
sachit patil
Regular Advisor

Re: Format File system.

hi
you can use #mediainit /dev/dsk/c0t0d0


gigiz
Valued Contributor

Re: Format File system.

OK