Linux automatically detects SSD, and since kernel version 2.6.29, you may verify sda with:
You should get 1 for hard disks and 0 for a SSD.
It will probably not work if your disk is a logical device emulated by hardware (like a RAID controller).
See this answer for more information...
There are many tools for that, for example fdisk -l or parted -l, but probably the most handy is lsblk (aka list block devices):
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 238.5G 0 disk
├─sda1 8:1 0 200M 0 part /boot/efi
├─sda2 8:2 0 500M 0 part /boot
When a program reads or writes data from a file, the requests go to a kernel driver. If the file is a regular file, the data is handled by a filesystem driver and it is typically stored in zones on a disk or other storage media, and the data that is read from a file is what was previously written in that place. There are other file types for which different ...
If I understand your question you want to know which device was used for a given mount. For this you can use the df command:
$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/fedora_greeneggs-root 50G 21G 27G 44% /
devtmpfs 3.8G 0 3.8G 0% /dev
I think you might be able to accomplish what you want using network block devices (NBD). Looking at the wikipedia page on the subject there is mention of a tool called nbd. It's comprised of a client and server component.
In this scenario I'm setting up a CDROM on my Fedora 19 laptop (server) and I'm sharing it out to an Ubuntu 12.10 system (client)...
See Documentation/device-mapper/zero.txt for usage. This target has no target-specific parameters.
The "zero" target create that functions similarly to /dev/zero: All reads return binary zero, and all writes are discarded. Normally used in tests [...]
This creates a 1GB (1953125-sector) zero target:...
On Linux we have findmnt from util-linux exactly made for this
findmnt -n -o SOURCE --target /path/to/FILE
The advantage about other solutions is that it still works if paths are obscured by symlinks or duplicate bind mounts.
Those are simply (special) files. They only serve as "pointers" to the actual device. (i.e. the driver module inside the kernel.)
If some command/service already opened that file, it already has a handle to the device and will continue working.
If some command/service tries to open a new connection, it will try to access that file and fail because of "file ...
I needed to do this on the VPS and none of the provided solutions worked for me,
this answer did the trick
so, it is about reading random data from the drive and assessing the time.
time for i in `seq 1 1000`; do
dd bs=4k if=/dev/sda count=1 ...
There are multiple ways of accomplishing this.
1. Add your user to the group that owns the device
Generally in most distros, block devices are owned by a specific group. All you need to do is add your user to that group.
For example, on my system:
# ls -l /dev/sdb
brw-rw---- 1 root disk 8, 16 2014/07/07-21:32:25 /dev/sdb
Thus I need to add my user to ...
Another way to quickly see the filesystems is the command df.
On my machine (Finnish localization) it shows like this:
Tiedostojärjestelmä 1K-lohkot Käyt Vapaana Käy% Liitospiste
/dev/root 38317204 19601752 16762352 54% /
devtmpfs 4063816 0 4063816 0% /dev
tmpfs 4097592 ...
Assuming you're on Linux.
sudo /lib/udev/scsi_id --page=0x80 --whitelisted --device=/dev/sdc
You can also get information (including labels) from the filesystems on the different partitions with
sudo blkid /dev/sdc1
The pathid will help to determine the type of device:
readlink -f /sys/class/block/sdc/...
libata does not have a noprobe option at all; that was a legacy IDE option...
But I went and wrote a kernel patch for you that implements it. It Should apply to many kernels very easily (the line above it was added 2013-05-21/v3.10-rc1*, but can be safely applied manually without that line).
Update The patch is now upstream (at least in 3.12.7 stable ...
Yes, you can do this with the /sys filesystem.
/sys is a fake filesystem dynamically generated by the kernel & kernel drivers.
In this specific case you can go to /sys/block/sda and you will see a directory for each partition on the drive. There are 2 specific files in those folders you need, start and size. start contains the offset from the beginning ...
The other answers don't show the UUID which is useful to use as reference in boot scripts and configs like /etc/hdparm. so here:
$ sudo lsblk --output NAME,FSTYPE,LABEL,UUID,MODE
NAME FSTYPE LABEL UUID MODE
├─sda1 ntfs WinHyperX ...
Probably you will never be able to find a simple definition of this. But in the most general and simplistic way, if you compare a character device to a block device, you can say the character device gives you direct access to the hardware, as in you put in one byte, that byte gets to the hardware (of course it is not as simple as that in this day and age). ...
You can throttle a pipe with pv -qL (or cstream -t provides similar functionality)
tar -cf - . | pv -q -L 8192 | tar -C /your/usb -xvf -
-q removes stderr progress reporting.
The -L limit is in bytes.
More about the --rate-limit/-L flag from the man pv:
-L RATE, --rate-limit RATE
Limit the transfer to a maximum of RATE bytes per second.
SCSI is not only a type of hardware interface, but also a command protocol, which is used for abstraction of most of the modern storage devices. Linux scsi driver is a high level driver that handles a variety of storage hardware.
Extract from SCSI on wikipedia:
Other technologies which use the SCSI ...
On a hybrid solid-state and spinning disk system (like the one I'm typing this), you have two to three aims:
Speed up your system: as much commonly used data as possible stays on the SSD.
Keep volatile data off the SSD to reduce wear.
Optional: have some level of redundancy by using an md(4) (‘software RAID’) setup across the SSD and HDD(s).
If you're just ...
Mounts, typically, must be done on block devices. The loop driver puts a block device front-end onto your data file.
If you do a loop mount without losetup then the OS does one in the background.
$ dd if=/dev/zero of=/tmp/foo bs=1M count=100
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 0.0798775 s, 1.3 GB/s
$ mke2fs /tmp/foo
You can do that with the device mapper and its snapshot target.
Basically, you'd do the same as what LVM does when you create a writable snapshot.
size=$(blockdev --getsz "$dev")
loop=$(losetup -f --show -- "$ovl")
printf '%s\n' "0 $size snapshot $dev $loop P 8" |
dmsetup create "$...
One alternative to nbd (if you're interested) is using iSCSI. tgtd can be configured to have a /dev device as its backing storage for a particular iSCSI IQN.
If you're on a RHEL system so you just need to install scsi-target-utils and then configure/start tgtd on the source system. Configuration of tgtd can get involved but Red Hat provides plenty of ...
From what I can tell, camcontrol devlist is the closest thing to a lsblk variant for FreeBSD. I'm not 100% sure that this is the best method, but its output is very close to what lsblk gives you, if you only care about /dev/<DEV-PATH> and device names:
$ camcontrol devlist
<VBOX HARDDISK 1.0> at scbus0 target 0 lun 0 (ada0,pass0)
File systems expect to read from and write to block devices, but image files aren’t block devices. Loop devices provide a block device on top of a file (or another block device, optionally with remapping).
There’s no need to consider loop devices when mounting images in many cases because mount takes care of everything for you; but loop devices are still ...