Sponsored Content
Full Discussion: How to read a disk label?
Top Forums UNIX for Dummies Questions & Answers How to read a disk label? Post 302458587 by chebarbudo on Friday 1st of October 2010 07:26:21 AM
Old 10-01-2010
Error How to read a disk label?

Hi there,

I'm wondering how to display a disk label (why not edit it but I don't need that yet).
I found several commands on forums like disklabel and diskinfo but I can't find them on my system and don't know the package they belong to.

Can you help me?

Cheers
Santiago
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Cannot label disk when partitions are in use as described

:confused: Hello, In my Solaris system, I want to resize my mounted home directory slice. 1.I unmount the slice, #umount /export/home 2.Resize the directory #format>partition> 3.#format>label 4.#format>Cannot label disk when partitions are in use as described. So, How can label ? Thanks (2 Replies)
Discussion started by: XNOR
2 Replies

2. Solaris

Warning: No Disk Label

Hi Fellows, I am trying to mirror 2 identical disks on a SUN Ultra 10 machines (with new installation of Solaris 8). In the process, I found 2 issues: 1. prtvtoc /dev/rdsk/c0t0d0s0 | fmthard -s - /dev/rdsk/c0t1d0s0 Result: Disk partitions between the 2 disks do not match up. 2. manually... (2 Replies)
Discussion started by: o51974
2 Replies

3. Solaris

ZFS disk label missing

I 'm having problem in importing a zfs pool was getting error device missing and upon further digging found that labels on my disk for zpool are missing Does anyone know how to recover from it ? root@essapl020-u006 # zdb -l /dev/dsk/emcpower0c --------------------------------------------... (0 Replies)
Discussion started by: fugitive
0 Replies

4. Solaris

Help:"Bad checksum in disk label" and "Can't open disk label package"?

Hello, I'm brand new to Sun/Solaris. I have a Sun Blade 150, with SunOS 5.8. I wanted to make a backup to prevent future data loss, so I put the disk in a normal PC with Windows XP to try to make a backup with Norton Ghost, the disk was detected, but not the file volume, so I place the disk... (6 Replies)
Discussion started by: Resadija
6 Replies

5. Hardware

Unrecognized disk label of a external HD

I have a external HD that I can't seem to open. When I try to open it with gparted it says unrecognized disk. When I run gparted from the terminal this is what it says. ~ $ sudo gparted ====================== libparted : 2.2 ====================== /dev/sdb: unrecognised disk label When I... (18 Replies)
Discussion started by: cokedude
18 Replies

6. Solaris

label a slice on disk erorr

Hi there, I am trying to do root volume mirroring on SunFire V210 server. I have two disks in it.First one is c1t0do and second one is c1t1do. Both disks already have partitions in them so I am deleting the partitions of second disk(c1t1do) using format command and selecting cylinder start 0... (2 Replies)
Discussion started by: newbi8321
2 Replies

7. Solaris

Script to label a disk

Hi Guys, Do you have any script to label a disk automatically. It is part of my script but I am not able to find solution to label this inside script without user intervention. (2 Replies)
Discussion started by: prashant2507198
2 Replies

8. AIX

Need help manually assigning a disk volume label

I've managed to bork a volume label on a disk that's shared out via GPFS. There has to be a fairly simple dd command to rewrite the blocks in question, but I can't seem to dig up the information necessary anywhere I look. Any help would be greatly appreciated! Fri Feb 28 15:20:26 EST 2014:... (1 Reply)
Discussion started by: kneemoe
1 Replies

9. Hardware

Unrecognized disk label on my external HD

Hi everyone, I have an external hard drive and I accidentally deleted the partition table. Can I restore my files? If I try to run the f-disk command this is what it says Disk /dev/sda: 320.1 GB, 320072933376 bytes 255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors Units =... (1 Reply)
Discussion started by: Sampa
1 Replies

10. Solaris

Bad magic number in disk label.

This is first time post...found this forum when looking for possible solution to fix my sun pc. Just one day can't boot it already showing the following: Boot device: disk File args: Bad magic number in disk label Can't open disk label package Evaluating: boot Can't open boot device... (40 Replies)
Discussion started by: SHuKoSuGi
40 Replies
DISKLABEL(8)						      System Manager's Manual						      DISKLABEL(8)

NAME
disklabel - read and write disk pack label SYNOPSIS
disklabel -r disk disklabel -w [ -r ] disk disktype [ packid ] disklabel -e [ -r ] disk disklabel -R [ -r ] disk protofile disklabel [ -NW ] disk disklabel -B [ -b boot ] disk [ disktype ] disklabel -w -B [ -b boot ] disk disktype [ packid ] disklabel -R -B [ -b boot ] disk protofile [ disktype ] DESCRIPTION
Disklabel can be used to install, examine or modify the label on a disk drive or pack. When writing the label, it can be used to change the drive identification, the disk partitions on the drive, or to replace a damaged label. On some systems, disklabel can be used to install bootstrap code as well. There are several forms of the command that read (display), install or edit the label on a disk. Each form has an additional option, -r, which causes the label to be read from or written to the disk directly, rather than going through the system's in-core copy of the label. This option may allow a label to be installed on a disk without kernel support for a label, such as when labels are first installed on a system; it must be used when first installing a label on a disk. The specific effect of -r is described under each command. The read and install forms also support the -B option to install bootstrap code. These variants are described later. The first form of the command (read) is used to examine the label on the named disk drive (e.g. ra0 or /dev/rra0a). It will display all of the parameters associated with the drive and its partition layout. Unless the -r flag is given, the kernel's in-core copy of the label is displayed; if the disk has no label, or the partition types on the disk are incorrect, the kernel may have constructed or modified the label. If the -r flag is given, the label from the raw disk will be displayed rather than the in-core label. The second form of the command, with the -w flag, is used to write a standard label on the designated drive. The required arguments to disklabel are the drive to be labelled (e.g. sd0), and the drive type as described in the disktab(5) file. The drive parameters and parti- tions are taken from that file. If different disks of the same physical type are to have different partitions, it will be necessary to have separate disktab entries describing each, or to edit the label after installation as described below. The optional argument is a pack identification string, up to 16 characters long. The pack id must be quoted if it contains blanks. If the -r flag is given, the disk sec- tors containing the label and bootstrap will be written directly. A side-effect of this is that any existing bootstrap code will be over- written and the disk rendered unbootable. If -r is not specified, the existing label will be updated via the in-core copy and any boot- strap code will be unaffected. If the disk does not already have a label, the -r flag must be used. In either case, the kernel's in-core label is replaced. An existing disk label may be edited by using the -e flag. The label is read from the in-core kernel copy, or directly from the disk if the -r flag is also given. The label is formatted and then supplied to an editor for changes. If no editor is specified in an EDITOR environment variable, vi(1) is used. When the editor terminates, the formatted label is reread and used to rewrite the disk label. Exist- ing bootstrap code is unchanged regardless of whether -r was specified. With the -R flag, disklabel is capable of restoring a disk label that was formatted in a prior operation and saved in an ascii file. The prototype file used to create the label should be in the same format as that produced when reading or editing a label. Comments are delim- ited by # and newline. As with -w , any existing bootstrap code will be clobbered if -r is specified and will be unaffected otherwise. The -NW flags for disklabel explicitly disallow and allow, respectively, writing of the pack label area on the selected disk. The final three forms of disklabel are used to install bootstrap code on machines where the bootstrap is part of the label. The bootstrap code is comprised of one or two boot programs depending on the machine. The -B option is used to denote that bootstrap code is to be installed. The -r flag is implied by -B and never needs to be specified. The name of the boot program(s) to be installed can be selected in a variety of ways. First, the names can be specified explicitly via the -b flag. If the name is not explicitly given, standard boot blocks will be used. The boot programs are located in /mdec. The names of the program is taken from the ``b0'' parameter of the disk- tab(5) entry for the disk if disktype was given and its disktab entry exists and includes that parameter. Otherwise, the boot program name is derived from the name of the disk. These name is of the form basenameuboot ; for example, /usr/mdec/rauboot if the disk device is ra0. The first of the three boot-installation forms is used to install bootstrap code without changing the existing label. It is essentially a read command with respect to the disk label itself and all options are related to the specification of the boot program as described previ- ously. The final two forms are analogous to the basic write and restore versions except that they will install bootstrap code in addition to a new label. FILES
/etc/disktab /mdec/xxuboot EXAMPLES
disklabel sd0 Display the in-core label for ra0 as obtained via /dev/rra0a. disklabel -w -r /dev/rra0a ra81x foo Create a label for sd0 based on information for ``ra81x'' found in /etc/disktab. Any existing bootstrap code will be clobbered. disklabel -e -r ra0 Read the on-disk label for ra0, edit it and reinstall in-core as well as on-disk. Existing bootstrap code is unaffected. disklabel -R ra0 mylabel Restore the on-disk and in-core label for sd0 from information in mylabel. Existing bootstrap code is unaffected. disklabel -B ra0 Install a new bootstrap on ra0. The boot code comes from /mdec/rauboot. On-disk and in-core labels are unchanged. disklabel -w -B /dev/rra0a -b newboot ra81x Install a new label and bootstrap. The label is derived from disktab information for ``ra81x'' and installed both in-core and on-disk. The bootstrap code comes from the file /mdec/newboot. SEE ALSO
disktab(5), disklabel(5) DIAGNOSTICS
The kernel device drivers will not allow the size of a disk partition to be decreased or the offset of a partition to be changed while it is open. Some device drivers create a label containing only a single large partition if a disk is unlabeled; thus, the label must be writ- ten to the ``a'' partition of the disk while it is open. This sometimes requires the desired label to be set in two steps, the first one creating at least one other partition, and the second setting the label on the new partition while shrinking the ``a'' partition. BUGS
When a disk name is given without a full pathname, the constructed device name uses the ``a'' partition on the tahoe and pdp-11 the ``c'' partition on all others. 3rd Berkeley Distribution April 21, 1995 DISKLABEL(8)
All times are GMT -4. The time now is 01:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy