Tag Info

New answers tagged

0

Perhaps not beautiful: for d in `fdisk -l 2>/dev/null | grep "^Disk " | cut -d":" -f1 | cut -f2` do if [ `fdisk -l $d 2>/dev/null | grep -c "/dev/sda1"` -gt 0 ] then echo On disk $d fi done It works only for 'real' disks not for LVM.


1

You can observe in /sys the block device for a given partition name. Eg for /dev/sda1: $ ls -l /sys/class/block/sda1 lrwxrwxrwx 1 root root /sys/class/block/sda1 -> \ ../../devices/pci0000:00/.../ata1/host0/target0:0:0/0:0:0:0/block/sda/sda1 A script to take arg /dev/sda1 and print /dev/sda is: part=$1 part=${part#/dev/} disk=$(readlink ...


2

iostat is part of the sysstat package, which is able to show overall iops if desired, or show them separated by reads/writes. Run iostat with the -d flag to only show the device information page, and -x for detailed information (separate read/write stats). You can specify the device you want information for by simply adding it afterwards on the command ...


3

Solaris has a built in format command which has analyze and purge subcommands to do this. See https://blogs.oracle.com/cmt/entry/erasing_disks_securely for more information.


0

This is solved by manually delete /dev/sdc device file, which kept exist after the USB drive is unplugged. It seems the issue is caused by some kind of un-updated device metadata.


2

The master boot record (MBR) at the beginning of a disk contains only 446 bytes of code, so it is tiny and cannot do much. Therefore, a common booting technique is to do what is called "chain loading," where the MBR loads code at the beginning of the active partition and jumps to that code. By leaving the first two sectors free, the EXT file system allows ...


3

The method you are using by creating a /forcefsck file in the root directory of each filesystem you want to force a check on, only works in a pure SysVinit environment, or an older Upstart init environment. It doesn't work on a system using systemd init. I also am assuming you are on an ext4 filesystem. The way to run a one time filesystem check at boot ...



Top 50 recent answers are included