Sponsored Content
Operating Systems Linux Red Hat Make a disk disappear from fdisk output Post 302919252 by Aia on Monday 29th of September 2014 09:16:28 PM
Old 09-29-2014
Quote:
Originally Posted by saurabh84g
Thanks.. :-)

What if we do not have use awk. I am looking at as

Suppose a disk /dev/sdd is gone faulty and we do not want this disk to be visible ...isnt there is somewhere we can blacklist kinda do for this disk....so, that whoever is firing fdisk -l does not have to remember the faulty disk name ???
Temporarily (until next boot) remove disk sdd from system
Code:
echo 1 > /sys/block/sdd/device/delete

If you want to add disk sdd back to the system without reboot you must know the host number BEFORE removing it, which the following command will do.
Code:
 readlink /sys/block/sdd

The red part is what you need:
Code:
../devices/pci0000:00/0000:00:10.0/host2/target2:0:3/2:0:3:0/block/sdd

Knowing that you can re-enable that disk executing:

Code:
echo "- - -" > /sys/class/scsi_host/host2/scan

This User Gave Thanks to Aia For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

how to make a boot disk

I need to know how to make a boot disk to get Solaris 7 to load on a intel machine. I have checked out Sun.Com, but did not understand how to download and convert the files to a disk. any help would be appericated thanks Bobby (2 Replies)
Discussion started by: Youngadmin
2 Replies

2. Shell Programming and Scripting

how to make a line BLINKING in output and also how to increase font size in output

how to make a line BLINKING in output and also how to increase font size in output suppose in run a.sh script inside echo "hello world " i want that this should blink in the output and also the font size of hello world should be big .. could you please help me out in this (3 Replies)
Discussion started by: mail2sant
3 Replies

3. Shell Programming and Scripting

Make the typed text disappear...

Hi all... I-m quite a new user of UNIX and i was trying to write a simple program and my problem is the following:how can i make a typed letter disappear (as we see in the MORE command, when we type <space>, b, q etc...) i know that for typing some text that has to be read it's used the structure:... (0 Replies)
Discussion started by: Cellofan
0 Replies

4. Solaris

How to make sure that a disk is not used?

Hi, I want to make sure a local disk c1t1d0s2 is not being used. SVM and VxVM are used on this Solaris 10 systems. This disk can not be found using 'df -k', 'metastat' and 'vxprint -ht'. But I can't mount it though format shows it contains ufs filesystem: # mount /dev/dsk/c1t1d0s0 /mnt Aug 18... (5 Replies)
Discussion started by: aixlover
5 Replies

5. Solaris

Fdisk partitions on boot disk and disaster recovery

I'm preparing to recover a Oracle Fire X4170 server in a disaster recovery test at a different location than in prod. I have some questions about fdisk partitions. I'm using Solaris 10 update 10. On my prod server, the boot disk has 2 partitions, diagnostic and solaris. Is the diagnostic... (1 Reply)
Discussion started by: TKD
1 Replies

6. UNIX for Dummies Questions & Answers

add disk redhat, fdisk -l doesn't work

i'm trying to add disk to red hat , use fdisk -l but it doesn't recognize it what should i do it to get it works? (3 Replies)
Discussion started by: prpkrk
3 Replies

7. BSD

OpenBSD fdisk - Linux fdisk compatibility ?

Hello, MBR partition table made by linux fdisk looks certainly not correct when printed by openbsd fdisk: Partition table created on linux (centos 6.3): # fdisk -l /dev/sdc Disk /dev/sdc: 10.7 GB, 10737418240 bytes 255 heads, 63 sectors/track, 1305 cylinders Units = cylinders of 16065 *... (2 Replies)
Discussion started by: vilius
2 Replies

8. UNIX for Dummies Questions & Answers

How can we identify SAN devices in fdisk -l output.?

We can Know the storage devices in fdisk -l. But Please tell me how can i identify the SAN devices :wall: How SAN devices are represented in the fdisk -l output :wall::wall: Thanks in Advance........:D (3 Replies)
Discussion started by: vamshigvk475
3 Replies

9. Red Hat

Fdisk reports the old size after disk resize

Hi, I'm running a Red Hat Enterprise Linux Server release 5.3 (Tikanga) on VMWare. It is a production system for which I may not get downtime soon. I happened to resize a underlying disk and the changes are not reflecting in the fdisk ouput. Further details are as follows. The disk which i... (3 Replies)
Discussion started by: maverick_here
3 Replies

10. Shell Programming and Scripting

Use of awk/sed to filter out fdisk output

Hi , I am trying to filter out the below output of fdisk -l command : fdisk -l Disk /dev/sda: 42.9 GB, 42949672960 bytes 255 heads, 63 sectors/track, 5221 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 ... (9 Replies)
Discussion started by: omkar.jadhav
9 Replies
cmdk(7D)							      Devices								  cmdk(7D)

NAME
cmdk - common disk driver SYNOPSIS
cmdk@target, lun : [ partition | slice ] DESCRIPTION
The cmdk device driver is a common interface to various disk devices. The driver supports magnetic fixed disks and magnetic removable disks. The block-files access the disk using the system's normal buffering mechanism and are read and written without regard to physical disk records. There is also a "raw" interface that provides for direct transmission between the disk and the user's read or write buffer. A sin- gle read or write call usually results in one I/O operation; raw I/O is therefore considerably more efficient when many bytes are transmit- ted. The names of the block files are found in /dev/dsk; the names of the raw files are found in /dev/rdsk. I/O requests to the magnetic disk must have an offset and transfer length that is a multiple of 512 bytes or the driver returns an EINVAL error. Slice 0 is normally used for the root file system on a disk, slice 1 as a paging area (for example, swap), and slice 2 for backing up the entire fdisk partition for Solaris software. Other slices may be used for usr file systems or system reserved area. Fdisk partition 0 is to access the entire disk and is generally used by the fdisk(1M) program. FILES
/dev/dsk/cndn[s|p]n block device (IDE) /dev/rdsk/cndn[s|p]n raw device (IDE) where: cn controller n dn lun n (0-7) sn UNIX system slice n (0-15) pn fdisk partition(0) /kernel/drv/cmdk 32-bit kernel module. /kernel/drv/amd64/cmdk 64-bit kernel module. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Architecture |x86 | +-----------------------------+-----------------------------+ SEE ALSO
fdisk(1M), mount(1M), lseek(2), read(2), write(2), readdir(3C), scsi(4), vfstab(4), attributes(5), dkio(7I) SunOS 5.10 9 Oct 2004 cmdk(7D)
All times are GMT -4. The time now is 07:04 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy