New answers tagged

0

Ypu can write your own FUSE filesystem (what you can do using almost any scripting/programming language, even bash) , that would just proxy filesystem calls to pointed filesystem (and eventually translate paths) plus monitor what you minght want to monitor. Otherwise you might investigate output of strace for programs performing I/O calls ofninterest, if ...


0

This script would do the trick, at least for most typical scenarios. It requires on blkid, lsscsi and sed: #!/bin/bash mkdir -p /dev/disk/by-{path,uuid} for dev in `blkid -o device | grep -v block`; do ln -s "$dev" "/dev/disk/by-uuid/$(blkid -o value -s UUID "$dev")" done lsscsi -v | sed 'N;s/\n//' |\ sed ...


0

I have a pair of scripts that build upon the answer by Wyzard. The first, scsi-drop, is to safely detach a single disk: #!/bin/sh if test -h "$1" then disk=$(chase "$1") else disk="$1" fi if test -b "$disk" then echo 1 >/sys/block/$(basename "$disk")/device/delete else echo "$0: not a block device: $1" >&2 exit 1 fi Its ...


0

Personally i get the entire scsi directory in /lib/modules/3.16.0-4-amd64/kernel/drivers/ (in example for jessie) on a pc freshly installed and put it in /lib/modules/3.16.0-4-amd64/kernel/drivers/ in initrd.gz of installer (http://www.thegeekstuff.com/2009/07/how-to-view-modify-and-recreate-initrd-img/) With that, no problem on all recent dell workstations ...


1

iotop is your friend (assuming your server runs Linux).


0

It looks like the only disk that remembers the "diskpool" pool is ata-ST8000AS0002-1NA17Z_Z840DG92, so what you can do is overwrite the label on that disk: # zpool create -f foo ata-ST8000AS0002-1NA17Z_Z840DG92 # zpool destroy foo That should prevent the "zpool import" command from seeing the long-defunct diskpool. Be careful to make sure that ...


1

Others have explained what they do, so I'll skip that. The point in dd having seperate bs and count argument is that bs controls how much is written at a time. Specifying really large values for bs will require a really large buffer in the program, and specifying values less than the block size of the device will be slow because the kernel has to build an ...


19

dd if=/dev/zero of=/dev/sda bs=4096 count=4096 Q: why 4096 is particularly used for counter? This will zero out the first 16 MiB of the drive. 16 MiB is probably more than enough to nuke any "start of disk" structures while being small enough that it won't take very long. dd if=/dev/zero of=/dev/sda bs=512 count=4096 seek=$(expr blockdev --getsz ...


4

Those commands will overwrite your sda device with zeroes -- the first one will do the first 16MB (block size of 4096 and count of 4096 blocks) and the 2nd one will overwrite the last 2MB (512 block size with 4096 blocks) with zeroes. (it's not technically erasing, and that relates to my first point below.) (that was the part already mentioned in other ...


12

This will erase the first 4096*4096=16MB and last 512*4096=2MB of your hard drive, which contain important structures useful for recovery. I assume this code was posted maliciously. I've never encounter a situation where explicitly specifying a count other than 1 was useful. I have erased the first block if I wanted to ensure I wasn't leaving any traces of ...


0

fdisk reports "bogus" physical sector sizes. A kind of "historical compatibility". The system or the disk hardware is able to emulate 512-byte sectors if the alignment of your partitions requires this, but it is slower (and probably wears off SSDs faster). That's why it is widely recommended to align partitions on larger boundaries, as are yours (they are ...


0

You can use the following command: lshw -class disk -class storage


2

Another one you can try in addition to what has already been suggested is: hdparm -I /dev/sda From the manpage: DESCRIPTION hdparm provides a command line interface to various kernel interfaces supported by the Linux SATA/PATA/SAS "libata" subsystem and the older IDE driver subsystem. Many newer (2008 and later) USB drive enclosures now ...


4

If you are looking for partitioning information you can use fdisk or parted. If you are more interested into how the various partitions are associated with the mount points try lsblk which I often use as: lsblk -o "NAME,MAJ:MIN,RM,SIZE,RO,FSTYPE,MOUNTPOINT,UUID" to include UUID info. And finally smartctl -a /dev/yourdrive gives you detailed info like: ...


1

You can use lshw: sudo lshw -c disk But for newer kernels, i would suggest the portable and stable way of reading from sysfs: /sys/block/sd*/device/*



Top 50 recent answers are included