1. Managing Removable Media (Overview)
2. Managing Removable Media (Tasks)
Managing Removable Media (Task Map)
Removable Media Hardware Considerations
Diskette Hardware Considerations
How to Format a Diskette (rmformat)
How to Create a File System on Removable Media
How to Create a File System on a DVD-RAM
How to Check a File System on Removable Media
How to Repair Bad Blocks on Removable Media
Applying Read or Write Protection and Password Protection to Removable Media
How to Enable or Disable Write Protection on Removable Media
How to Enable or Disable Read or Write Protection and Set a Password on Removable Media
3. Accessing Removable Media (Tasks)
4. Writing CDs and DVDs (Tasks)
5. Managing Devices (Overview/Tasks)
6. Dynamically Configuring Devices (Tasks)
7. Using USB Devices (Overview)
9. Using InfiniBand Devices (Overview/Tasks)
11. Administering Disks (Tasks)
12. SPARC: Adding a Disk (Tasks)
13. x86: Adding a Disk (Tasks)
14. Configuring Oracle Solaris iSCSI Targets and Initiators (Tasks)
15. The format Utility (Reference)
16. Managing File Systems (Overview)
17. Creating ZFS, UFS, TMPFS, and LOFS File Systems (Tasks)
18. Mounting and Unmounting File Systems (Tasks)
19. Using The CacheFS File System (Tasks)
20. Configuring Additional Swap Space (Tasks)
21. Checking UFS File System Consistency (Tasks)
22. UFS File System (Reference)
23. Backing Up and Restoring UFS File Systems (Overview)
24. Backing Up UFS Files and File Systems (Tasks)
25. Using UFS Snapshots (Tasks)
26. Restoring UFS Files and File Systems (Tasks)
27. UFS Backup and Restore Commands (Reference)
28. Copying UFS Files and File Systems (Tasks)
You can use the rmformat command to format and protect rewritable diskettes. This utility does not require superuser privilege unless vold is not running. File systems are mounted automatically. So, you might have to unmount media before you can format it, if the media contains an existing file system.
The rmformat command has three formatting options:
quick – This option formats diskettes without certification or with limited certification of certain tracks on the media.
long – This option completely formats diskettes. For some devices, the use of this option might include the certification of the whole media by the drive.
force – This option formats completely without user confirmation. For diskettes with a password-protection mechanism, this option clears the password before formatting. This feature is useful when a password is forgotten. On diskettes without password protection, this option forces a long format.
Keep the following restrictions in mind when working with diskettes:
SPARC and x86 UFS formats are different. SPARC uses little-endian bit coding, x86 uses big-endian. Media formatted for UFS is restricted to the hardware platform on which they were formatted. So, a diskette formatted for UFS on a SPARC based platform cannot be used for UFS on an x86 platform. Likewise, a diskette formatted for UFS on an x86 platform cannot be used on a SPARC platform.
A complete format for SunOS file systems consists of the basic “bit” formatting in addition the structure to support a SunOS file system. A complete format for a DOS file system consists of the basic “bit” formatting in addition the structure to support either an MS-DOS or an NEC-DOS file system. The procedures required to prepare a media for each type of file system are different. Therefore, before you format a diskette, consider which procedure to follow. For more information, see Managing Removable Media (Task Map).
Keep the following in mind when formatting diskettes:
For information on diskette names, see Table 3-1.
Diskettes that are not named (that is, they have no “label”) are assigned the default name of unnamed_floppy.
Diskettes that are not named (that is, they have no “label”) are assigned the default name of floppy.
A Solaris system can format the following diskette types:
UFS
MS-DOS or NEC-DOS (PCFS)
UDFS
On a Solaris system (either SPARC or x86), you can format diskettes with the following densities.
|
By default, the diskette drive formats a diskette to a like density. This default means that a 1.44 MB drive attempts to format a diskette for 1.44 MB, regardless of whether the diskette is, in fact, a 1.44 MB diskette, unless you instruct it otherwise. In other words, a diskette can be formatted to its capacity or lower, and a drive can format to its capacity or lower.
For information about removable media hardware considerations, see Removable Media Hardware Considerations.
If you aren't sure, insert the media and check the status messages in the system console window, as described in Step 3. If you need to format the media, go to How to Format a Diskette (rmformat).
$ volcheck -v
Two status messages are possible:
Volume management detected the media and will attempt to mount it in the directory described in Table 3-1.
If the media is formatted properly, no error messages appear in the console.
If the media is not formatted, the “media was found” message is still displayed. However, error messages similar to the following appear in the system console window:
fd0: unformatted diskette or no diskette in the drive
fd0: read failed (40 1 0)
fd0: bad format
You must format the media before volume management can mount it. For more information, see Chapter 2, Managing Removable Media (Tasks).
Volume management did not detect the media. Ensure that the media is inserted properly, and run volcheck again. If unsuccessful, check the media, which could be damaged. You can also try to mount the media manually.
For example, do the following for a diskette:
$ ls /floppy floppy0 myfiles
Tip - floppy0 is a symbolic link to the actual name of the diskette. In this case, myfiles. If the diskette has no name but is formatted correctly, the system refers to it as unnamed_floppy.
If nothing appears under the /floppy directory, the diskette was either not mounted or is not formatted properly. To find out, run the mount command and look for the line that begins with /floppy (usually at the end of the listing):
/floppy/name on /vol/dev/diskette0/name
If this line does not appear, the diskette was not mounted. Check the system console window for error messages.
You can use the rmformat command to format a diskette. By default, this command creates two partitions on the media: partition 0 and partition 2 (the whole media).
$ svcs volfs STATE STIME FMRI online 10:39:12 svc:/system/filesystem/volfs:default
For information on restarting removable media services, see How to Disable or Enable Removable Media Services. For information on identifying media device names, see Using Removable Media Names.
$ rmformat -F [ quick | long | force ] device-name
See Formatting Diskettes for more information on rmformat formatting options.
If the rmformat output indicates bad blocks, see How to Repair Bad Blocks on Removable Media.
$ rmformat -b label device-name
For information on creating a DOS label, see mkfs_pcfs(1M).
Example 2-1 Formatting a Diskette
This example shows how to format a diskette.
$ rmformat -F quick /dev/rdiskette Formatting will erase all the data on disk. Do you want to continue? (y/n) y .........................................................................
$ rmformat -F quick device-name
$ rmformat -s slice-file device-name
A sample slice file appears similar to the following:
slices: 0 = 0, 30MB, "wm", "home" : 1 = 30MB, 51MB : 2 = 0, 94MB, "wm", "backup" : 6 = 81MB, 13MB
Create a UFS file system. For example:
# newfs /vol/dev/aliases/floppy0
Create a PCFS file system. For example:
# mkfs -F pcfs /dev/rdsk/c0t4d0s2:c
Create a UDFS file system. For example:
# mkfs -F udfs /dev/rdsk/c0t1d0s1
Example 2-2 Formatting a Diskette for a UFS File System
The following example shows how to format a diskette and create a UFS file system on the diskette.
$ rmformat -F quick /vol/dev/aliases/floppy0 Formatting will erase all the data on disk. Do you want to continue? (y/n) y $ su # /usr/sbin/newfs /vol/dev/aliases/floppy0 newfs: construct a new file system /dev/rdiskette: (y/n)? y /dev/rdiskette: 2880 sectors in 80 cylinders of 2 tracks, 18 sectors 1.4MB in 5 cyl groups (16 c/g, 0.28MB/g, 128 i/g) super-block backups (for fsck -F ufs -o b=#) at: 32, 640, 1184, 1792, 2336, #
$ rmformat -F quick /dev/rdiskette Formatting will erase all the data on disk. Do you want to continue? (y/n)y $ su # /usr/sbin/newfs /dev/rdiskette newfs: construct a new file system /dev/rdiskette: (y/n)? y /dev/rdiskette: 2880 sectors in 80 cylinders of 2 tracks, 18 sectors 1.4MB in 5 cyl groups (16 c/g, 0.28MB/g, 128 i/g) super-block backups (for fsck -F ufs -o b=#) at: 32, 640, 1184, 1792, 2336,
Example 2-3 Formatting a Diskette for a PCFS File System
This example shows how to create a PCFS file system with an alternate fdisk partition. In these examples, vold is not running.
$ rmformat -F quick /dev/rdsk/c0t4d0s2:c Formatting will erase all the data on disk. Do you want to continue? (y/n) y $ su # fdisk /dev/rdsk/c0t4d0s2:c # mkfs -F pcfs /dev/rdsk/c0t4d0s2:c Construct a new FAT file system on /dev/rdsk/c0t4d0s2:c: (y/n)? y #
This example shows how to create a PCFS file system without an fdisk partition.
$ rmformat -F quick /dev/rdiskette Formatting will erase all the data on disk. Do you want to continue? (y/n) y $ su # mkfs -F pcfs -o nofdisk,size=2 /dev/rdiskette Construct a new FAT file system on /dev/rdiskette: (y/n)? y #
Currently, vold doesn't support DVD-RAM devices. So, if you disable vold to use a DVD-RAM device, you cannot use CD-R, CD-RW, DVD-R, DVD-RW, DVD+R, DVD+RW devices because vold is not available during the time that it is disabled.
# svcadm disable volfs
Create a UFS file system. For example:
# newfs /dev/rdsk/c0t0d0s2
Create a UDFS file system. For example:
# mkfs -F udfs /dev/rdsk/c0t0d0s2
Mount a UFS file system. For example:
# mount -F ufs /dev/dsk/c0t0d0s2 /mnt
Mount a UDFS file system. For example:
# mount -F udfs /dev/dsk/c0t0d0s2 /mnt
# svcadm enable volfs
Check a UFS file system.
# fsck -F ufs device-name
Check a UDFS file system.
# fsck -F udfs device-name
Check a PCFS file system.
# fsck -F pcfs device-name
Example 2-4 Checking a PCFS File System on Removable Media
The following example shows how check the consistency of a PCFS file system on media. In this example, vold is not running.
# fsck -F pcfs /dev/rdsk/c0t4d0s2 ** /dev/rdsk/c0t4d0s2 ** Scanning file system meta-data ** Correcting any meta-data discrepancies 1457664 bytes. 0 bytes in bad sectors. 0 bytes in 0 directories. 0 bytes in 0 files. 1457664 bytes free. 512 bytes per allocation unit. 2847 total allocation units. 2847 available allocation units. #
You can only use the rmformat command to verify, analyze, and repair bad sectors that are found during verification if the drive supports bad block management. Most diskettes and USB memory sticks do not support bad block management.
If the drive supports bad block management, a best effort is made to rectify the bad block. If the bad block cannot be rectified despite the best effort mechanism, a message indicates the failure to repair the media.
$ rmformat -c block-numbers device-name
Supply the block number in decimal, octal, or hexadecimal format from a previous rmformat session.
$ rmformat -V read device-name
You can apply read protection or write protection, and set a password, on removable media that support this feature.
$ rmformat -p device-name
You can apply a password with a maximum of 32 characters for removable media that support this feature.
You will receive a warning message if you attempt to apply a password on media that does not support this feature.
Enable read protection or write protection.
$ rmformat -W enable device-name Please enter password (32 chars maximum): xxx Please reenter password:
$ rmformat -R enable device-name Please enter password (32 chars maximum): xxx Please reenter password:
Disable read protection or write protection and remove the password.
$ rmformat -W disable device-name Please enter password (32 chars maximum): xxx
$ rmformat -R disable device-name Please enter password (32 chars maximum): xxx
$ rmformat -p device-name
Example 2-5 Enabling or Disabling Read or Write Protection and Password Protection
This example shows how to enable write protection and set a password on a diskette.
$ rmformat -W enable /vol/dev/aliases/floppy0 Please enter password (32 chars maximum): xxx Please reenter password: xxx
This example shows to disable read protection and remove the password on a diskette.
$ rmformat -R disable /vol/dev/aliases/floppy0 Please enter password (32 chars maximum): xxx