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(9)						   BSD Kernel Developer's Manual					      DISKLABEL(9)

NAME
disklabel, readdisklabel, writedisklabel, setdisklabel, bounds_check_with_label -- disk label management routines SYNOPSIS
char * readdisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp, struct cpu_disklabel *clp); int writedisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp, struct cpu_disklabel *clp); int setdisklabel(struct disklabel *olp, struct disklabel *nlp, u_long openmask, struct cpu_disklabel *clp); int bounds_check_with_label(struct buf *bp, struct disklabel *lp, int wlabel); DESCRIPTION
This collection of routines provides a disklabel management interface to kernel device drivers. These routines are classified as machine- or architecture-dependent because of restrictions imposed by the machine architecture and boot-strapping code on the location of the label, or because cooperation with other operating systems requires specialized conversion code. readdisklabel() attempts to read a disklabel from the device identified by dev, using the device strategy routine passed in strat. Note that a buffer structure is required to pass to the strategy routine; it needs to be acquired and parameterized for the intended I/O operation, and disposed of when the operation has completed. Some fields in the disklabel passed in lp may be pre-initialized by the caller in order to meet device driver requirements for the I/O operation initiated to get to the disklabel data on the medium. In particular, the field ``d_secsize'', if non-zero, is used by readdisklabel() to get an appropriately sized buffer to pass to the device strategy routine. Unspeci- fied fields in lp should be set to zero. If the medium does not contain a native disklabel that can be read in directly, readdisklabel() may resort to constructing a label from other machine-dependent information using the provided buffer passed in the clp argument. If a disk label can not be found or constructed, a string containing an approximated description of the failure mode is returned. Otherwise the NULL string is returned. writedisklabel() stores disk label information contained in the disk label structure given by lp on the device identified by dev. Like readdisklabel(), it acquires and sets up an I/O buffer to pass to the strategy routine strat. writedisklabel() may elect to do a machine- dependent conversion of the native disk label structure (using the buffer pointed at by clp), to store the disk label onto the medium in a format complying with architectural constraints. writedisklabel() returns 0 on success and EINVAL if the disk label specifies invalid or inconvertible values. Otherwise, any error condition reported by the device strategy routine in the buffer's ``b_error'' field is returned. setdisklabel() checks a proposed new disk label passed in nlp for some amount of basic sanity. This includes a check on attempts to change the location, or reduce the size, of an existing disk partition that is currently in use by the system. The current disposition of the disk partitions is made available through olp and openmask, which provide, respectively, the existing disk label and a bit mask identifying the partitions that are currently in use. Failure to pass on ``basic sanity'', results in a EINVAL return value, while a vetoed update of the partition layout is signaled by a EBUSY return value. Otherwise, 0 is returned. bounds_check_with_label() is used to check whether a device transfer described by bp to the device identified by dev, is properly contained within a disk partition of the disk with label lp. If this check fails, bounds_check_with_label() sets the buffer's ``b_error'' field to EINVAL, sets the B_ERROR flag in ``b_flags'', and returns -1. If the argument wlabel is zero, and the transfer is a write operation, a check is done if the transfer would overwrite (a portion of) the disklabel area on the medium. If that is the case, EROFS is set in ``b_error'', the B_ERROR flag is set in ``b_flags'', and -1 is returned. Note that wlabel should be set to a non-zero value if the intended operation is expected to install or update the disk label. Programs that intend to do so using the raw device interface should notify the driver by using a DIOCWLABEL ioctl function. SEE ALSO
disklabel(5), disklabel(8) BSD
December 26, 1996 BSD
All times are GMT -4. The time now is 09:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy