date int64 1,220B 1,719B | question_description stringlengths 28 29.9k | accepted_answer stringlengths 12 26.4k | question_title stringlengths 14 159 |
|---|---|---|---|
1,507,025,938,000 |
Does the MBR of the disk contain this information and therefore when i call a command like fdisk, a kernel level code eventually runs and reads it from a specific part in MBR? If so, which part of it? What offset?
If it's not in the MBR, then how can these types of commands find it? They can't be reading it from the ... |
A device’s sector size isn’t stored in the MBR.
User space commands such as fdisk use the BLKBSZGET and BLKSSZGET ioctls to retrieve the sector sizes from disks. Those ioctls are handled by drivers in the kernel, which retrieve the relevant information from the drives themselves.
(There isn’t much documentation about ... | How do commands like fdisk -l find the sector size? |
1,507,025,938,000 |
I was just introduced to multipathing in our production environment and had never heard of the concept prior. After some digging I think I'm starting to get a handle on how the concept works in theory but I'm having some trouble extrapolating that to what I'm seeing on the box I'm working on.
From multipath -ll I get ... |
Your multipath'ed device is just an abstraction of multiple paths to one disk. So the corresponding relationship you are asking about is that the mpathN device is the same as the underlying device at the far end of whatever fabric you have.
As you saw, you can view the partition table on the mpath device and it's cons... | Understanding multipath and mountpoints |
1,507,025,938,000 |
I need to be able to read data sequentially from a file while not storing the data that is being read in the page cache as the file contents are not expected to ever be read again and also because there is memory pressure on the box (want to use the precious memory for useful disk I/O caching).
The question I have is ... |
Use direct IO:
Direct I/O is a feature of the file system whereby file reads and
writes go directly from the applications to the storage device,
bypassing the operating system read and write caches. Direct I/O is
used only by applications (such as databases) that manage their own
caches.
An application invokes direct... | Optimizing read I/O with read ahead while avoiding storing data in page cache |
1,507,025,938,000 |
we run the smartctl on sdb disk
smartctl -a /dev/sdb
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.10.0-327.el7.x86_64] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org
Smartctl open device: /dev/sdb failed: DELL or MegaRaid controller, please try adding '-d megaraid,N'
accor... |
Yes, you can use 0, or 12, or 13, or 14, or 16 for N.
If your scan output isn't complete, possibly even more numbers.
And you already tried with 0, and it worked. So try the others, too.
| smartctl megaraid,N ( how to find the right value for N ? ) |
1,507,025,938,000 |
I added a new disk (/dev/vdb) of 2TB with existing data from the previous 1TB disk.
I used fdisk /dev/vdb to extend its only partition /dev/vdb1 to full capacity of 2TB from previous 1TB. (In other words, I deleted vdb1, and then re-created it to fill the disk. See How to Resize a Partition using fdisk - Red Hat Custo... |
I used fdisk /dev/vdb to extend its only partition /dev/vdb1 to full capacity of 2TB from previous 1TB... See How to Resize a Partition using fdisk - Red Hat Customer Portal.
And then I did [resize2fs /dev/vdb1]...
We can see this did not change the size of your filesystem. Here is why:
resize2fs reads the size of t... | resize2fs fails to resize partition to full capacity? |
1,507,025,938,000 |
If I put a USB-drive in, it will automount. I can see it with lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sdb 8:16 1 7,5G 0 disk
└─sdb1 8:17 1 7,5G 0 part /media/user/usb-drive
If I unmount it with umount
umount /media/user/sdb1
it will still be visible with lsblk, but not mounted any more:
N... |
Mounting just means "set up the operating system to actively use the some (part of) a block device". Often there is some "busy" or "dirty" on the superblock that gets changed when a file system is mounted, but otherwise the hardware is unaffected.
OTOH, eject sends a SCSI "START STOP" command to the device, with optio... | Why is usb-drive not visible with `lsblk` after having been ejected from Thunar? |
1,507,025,938,000 |
Background Info:
Copying some .bin files to an SD card (to be read by an embedded device, no filesystem)
Commissioning the card requires some segments to be wiped (i.e. zero'd), and others to have binary files copied to them
Calling dd from a python script using subprocess module (as the dd operations involved are tr... |
Solution:
dd if='input_file.bin' \
of='/dev/sd{X}' \
bs={desired write block size} \
seek={start offset in bytes} \
count={write size in bytes} \
oflag=seek_bytes \
iflag=count_bytes
From the man page:
count_bytes
treat 'count=N' as a byte count (iflag on... | dd, seek with one block size, write with another block size |
1,507,025,938,000 |
I made a mistake of encrypting the entire LVM physical volume (contains both home, root, and swap) when installing a CentOS 6.4 (2.6.32-358.6.1.el6.x86_64) box. I soon came to realize that moving files takes a horrendous amount of time due to kcryptd running at 90% of CPU and that encryption was not really necessary a... |
That is possible. It requires
another Linux to boot (CD/DVD is OK)
some spare space outside the PV (100M would be good)
a certain amount of fearlessness...
Then you copy a block from the encrypted volume to the area outside the PV and (after success) to the unencrypted base device. After that you increase a counter ... | What's the easiest way to decrypt a disk partition? |
1,507,025,938,000 |
On most Linux systems udev usually creates symlinks in
/dev/disk/by-uuid/
/dev/disk/by-path/
which point to actual device nodes (/dev/sda, /dev/sdb, etc).
I don't have udev on my system, and I would like to generate these symlinks manually. I know I can use blkid to generate the by-uuid name.
But how can I generate t... |
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 's/.*\... | Command to generate /dev/disk/-by-path/ name on a system without udev daemon |
1,507,025,938,000 |
I want to capture only the disks from lsblk
as showing here fd0 also appears in spite its not really disk for use
in this case we can just do lsblk | grep disk | grep -v fd0
but maybe we missed some other devices that need to filter them by grep -v
what other disk devices that could be appears from lsblk | grep disk a... |
If you want only disks identified as SCSI by the device major number 8, without device partitions, you could search on device major rather than the string "disk":
lsblk -d | awk '/ 8:/'
where the -d (or --no-deps) option indicates to not include device partitions.
For reasonably recent linux systems, the simpler
lsbl... | lsblk + capture only the disks |
1,507,025,938,000 |
I have the following Debian that works in Virtual Box:
$ uname -a
Linux debian 3.2.0-4-amd64 #1 SMP Debian 3.2.51-1 x86_64 GNU/Linux
Recently I notice that I don't have any free space:
$ df
Filesystem 1K-blocks Used Available Use% Mounted on
rootfs ... |
That device has the same blocks, used and free space as your rootfs filesystem, so they are probably the same. You can check where the uuid points to with:
ls -l /dev/disk/by-uuid/ef55765f-dae5-426f-82c4-0d98265c5f2
My guess is that you just booted from a life filesystem on a CDROM image.
| What is the /dev/disk/by-uuid/ and why does it use all free space on the disk |
1,507,025,938,000 |
I installed Redhat 6.4 on KVM Server. Right Now there is only One Disk /dev/vda. Now I need to add extra Disk like /dev/vdb I tried adding New Volume but it is not showing when I do fdisk -l
How to add extra Volumes to existing running VMs
|
You can use the virsh option mentioned above (probably faster, in fact) or you can use the "Add Hardware" option in virt-manager to either add new space or assign existing space.
Simply open the VM, go to "Details" (top left), and select "Add Hardware" (bottom left):
Storage is the default type of hardware, so it sho... | How to Add Extra Disks on KVM based VM |
1,507,025,938,000 |
I currently have a 600gb disk, with Ubuntu installed, 600gb of which is given to the Ubuntu OS:
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 592G 16G 547G 3% /
udev 1.9G 4.0K 1.9G 1% /dev
tmpfs 777M 944K 776M 1% /run
none 5.0M 0 5.0M 0% /run/lock
... |
If you are using /dev/sda1 as your current system root, you will be unable to unmount it, and doing so would prevent you from running parted from it anyway.
resize2fs is able to enlarge ext3/4 filesystems while mounted on newer kernels, but not shrink them.
Your best bet is probably to use the gparted live CD or gpart... | Is it safe to resize partition on /? |
1,507,025,938,000 |
I would like to reduce the size of an ext4 partition from my disk and I would like to know if it is possible that my files become corrupted during the operation ? I learn that ext4 file system use large extents for each file, so is it possible that a file is located at the end of the partition and become corrupted/del... |
Yes, it is safe
As long as the process is not interrupted by i.e. power loss, your data will be fine. This is what resize2fs is made for. It will move data around so nothing is lost. it will warn you if you attempt something potentially harmful. I used resize2fs numerous times for offline shrinking and never experienc... | Is it safe to resize partition in ext4? |
1,507,025,938,000 |
When unlocking a newly-formatted LUKS volume, I received a warning in the kernel log:
kernel: device-mapper: table: 253:14: adding target device sdk1 caused an alignment inconsistency: physical_block_size=4096, logical_block_size=512, alignment_offset=0, start=33553920
According to another question, a false warning ... |
It appears that dmsetup computes its alignment from the optimal I/O size, without bothering to check that that is actually a multiple of the physical block size. As mentioned in the false warning question, this optimal I/O size makes sense due to USB constraints.
So the solution is simple: use --align-payload to overr... | dmsetup luksFormat creating an alignment inconsistency |
1,462,218,184,000 |
I use badblocks to test my 32GB class-10 microSD card that I use to boot my RPi. I already have a functioning file system on it, so I don't want to scan it with the -w option (destructive read-write test).
I have two options: I could use the default read-only test, or I could use a non-destructive read-write test (whi... |
The read-only test only reads. That's basically the default testing method for just about everything and pretty much the same what disks do for SMART self-tests.
The non-destructive read-write test works by overwriting data, then reading to verify, and then writing the original data back afterwards. The only way to ve... | What are the pros and cons of badblock's two non-destructive tests? |
1,462,218,184,000 |
My VirtualBox filesystem looks like:
# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda2 29799396 5467616 22795012 20% /
devtmpfs 1929980 0 1929980 0% /dev
tmpfs 1940308 12 1940296 1% /dev/shm
tmpfs 1940308 8712 1931596 1% /run
tmpfs... |
I didn't find the answer on how to use zerofree on such disks but I found an alternative solution which works well.
Mount your disk somewhere (in my case 3 disks are mounted to locations: /srv/node/d1, /srv/node/d2, /srv/node/d3).
Enter the directory where your disk is mounted (cd /srv/node/d1).
Perform the command: ... | How to use zerofree on a whole disk? |
1,462,218,184,000 |
I'm learning file operation calls under Linux. The read() and write() and many other functions use cache to increase performance, and I know fsync() can transfer data from cache to disk device.
However, is there any commands or system calls that can determine whether the data is cached or written to disk?
|
Read data is (directly) read from the cache only if it is already there. That implies that cached data was previously accessed by a process and kept in cache. There is no system call or any method for a process to know if some piece of data to be read is already in cache or not.
On the other hand, a process can select... | How to determine whether the data is written to disk or cached? |
1,462,218,184,000 |
I have /dev/sda mounted on /, as the root partition. Can I safely run badblocks in read-only mode on this device? Will it show false positives/negatives because it's mounted?
|
Read-only is just that - reading from the disk. It will pick up sector read errors but (obviously) not sector write errors.
Categorically, it is safe to run on a device that is being used a mounted filesystem.
With respect to possible false positives, block IO is not "managed", i.e. there are no reader/writer locks. S... | Can I safely run badblocks in read-only mode on a mounted drive? |
1,462,218,184,000 |
I have a cloud server were we get billed also for disk IO usage. Here is an example from the stats:
04/Sep/2013 07:24:19
04/Sep/2013 08:24:19
0,5 GB / 1 vCPU (0,08 Kr. per hour): Charge for 44.7578125GB disk I/O
So for one hour we get billed for around 45 GB disk I/O.
To me that sounds like a lot of traffic and I wou... |
You can use the tool iostat to collect the disk utilization information. It takes several arguments, including the switch, -d:
-d Display the device utilization report.
It also takes an argument in seconds an interval of how frequent it should re-run. The value 3600 would be the number of seconds in an hour.
... | How to measure total disk I/O per hour |
1,462,218,184,000 |
I am running Ubuntu 18.04.1 in a Virtual Machine (VMWare) on a Windows host. I am trying to zero out an entire SD card using dd. This is part of the process I use to release embedded Linux to the software group (SD card images compress much better when the empty FS data is all 0).
The command I am using is: sudo dd ... |
As said in the comments, the sdcard was with badblocks.
The solution I proposed was to run:
badblocks -t 0x0000 -sw /dev/sdc
CAUTION: this is data destructive like dd if=/dev/zero.
And the user received something like:
7234624 done, 39:10 elapsed. (0/0/2417408 errors)
Showing the sdcard was damaged.
The sdcard was... | dd doesn't overwrite the disk |
1,462,218,184,000 |
I want to find how can I check the disk usage in linux as in windows task manager.
I mean, I don't want to find out how much free space is there on the partition or something like that, I want to find out how much is the disk used at a given moment.
Here's a gif: https://i.gyazo.com/4a91e7ed2e519d6fe628811d7c03d6c3.gi... |
Your question and the gif are two separate things. Based on the gif what you need is monitoring disk I/O and that can be achieved by
iotop
you can find some examples here
| Disk usage equivalent to Disk usage in windows task manager |
1,462,218,184,000 |
I got a strange issue with extremely slow dnf, to the point where computer freezes for a few seconds during installation of packages. Running Fedora 29, but this is happening for years. Otherwise the computer works fine, never crashes, obviously only dnf hits some weak spot. Not only can "dnf upgrade" take an hour for... |
Robert:
It would be interesting to know what system call is taking the longest.
Can you install a simple (random) package using perf trace and then sort to find the longest calls?
For example:
# perf trace -s -o /tmp/trace.out dnf install -y xorg-x11-apps-7.7-20.fc28.x86_64
And then post the contents of your /tmp/tra... | Extremely slow dnf |
1,462,218,184,000 |
Premise
I am running Linux Mint on my sister's computer. Everything was working fine, but then one day she turned it on and she got a strange message she didn't understand. I think it was some kind of question in terminal. Unfortunately my sister, despite her natural intelligence, didn't know what to do and decided t... |
It's hard to say how much I can concider this as an answer, but it is a solution. I finally decided to give a try to 32bit installation ISO, which miraclously worked. I installed the system and everything works fine. When I tried again (after the install) the 64bit ISO could be loaded. I have no idea why what so ever.... | Linux Mint freezes on startup |
1,462,218,184,000 |
I run Ubuntu-20 and I have scanned my laptop using smartctl. The test results are as follows:
SMART Attributes Data Structure revision number: 32
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate ... |
Yes, your drive is failing:
5 Reallocated_Sector_Ct 0x0033 001 001 005 Pre-fail Always FAILING_NOW 9800
There’s nothing you can do to make the drive “better”. What you need to do next depends on what backups you have, if any. If you don’t have any, stop using your system and get an external drive at le... | Is my drive failing and is this the same reason my laptop is running slower? |
1,462,218,184,000 |
I've read information about the use of sync command in Linux and how it works.
But I'm unable to understand when I really should use it in files and I don't find practical examples.
For example, the command sync --data file.txt synchronizes the file data of this one, but I don't find an useful example about when I sho... |
I/O in Linux is done to the Virtual File System (VFS). The VFS caches data structures from the various types of filesystem
(ext?/XFS/BTFS, NFS, COW, FUSE etc). This means that any process I/O can use a common interface. Having the filesystem
structure in memory also makes directory and inode lookups far faster than... | When and why should I sync a file in Linux? |
1,462,218,184,000 |
I am a bit confused with how linux hard drive/ storage device, block files are named.
My questions are:
How are IDE devices and partitions named?
How are EIDE devices and partitions named?
How are PATA devices and partitions named?
How are SATA devices and partitions named?
How are SCSI devices and partitions named?
... |
Introduction
First of all, all the devices populate the /dev folder.
Also, it is important to note that (E)IDE and PATA terms usually refer to the same thing, which is the interface standard PATA. IDE and PATA are interchangable terms in this context.
There was a major change in naming conventions for block devices in... | Linux block devices naming |
1,462,218,184,000 |
I was fiddling around with parted command on a loopback disk and tried to create some partitions using gpt part table but I keep getting Error: Unable to satisfy all constraints on the partition. when trying to create a logical partition
$ sudo parted /dev/loop0
(parted) mktable gpt
(parted) mkpart primary 1MiB 201MiB... |
The extended and logical partitions make sense only with msdos partition table. It's only purpose is to allow you to have more than 4 partitions. With GPT, there are only 'primary' partitions and their number is usually limited to 128 (however, in theory there is no upper limit implied by the disklabel format). Note t... | Unable to create logical partition with Parted |
1,462,218,184,000 |
I have some HDD disk which has 4096 physical sector size and 512 bytes logical size. It is SATA disk. Now I'd like to use 4kiB in Linux as a logical also sector size - not 512 bytes one. How can I achieve this? Is it possible to switch this disk to operate only in 4kiB mode?
How can I be sure that all the partitions ... |
Unless you use options to force a legacy MS-DOS compatible mode, or use expert mode to specify exact LBA block numbers for the beginning and end of partitions, most modern partitioning tools (Linux and otherwise) will align partitions to multiples of 1MB by default. This is also what modern Windows does, and it guaran... | Switching HDD sector size to 4096 bytes |
1,462,218,184,000 |
For example, when I archive a few gigs of files (using tar), Linux uses quite a lot of disk caching (and some swap) but never cleans it up when the operation has completed. As a result, because there's no free memory Linux will try to swap out something from memory which in its turn creates an additional load on CPU. ... |
Nitpick: the CPU time used by swapping is not usually significant. When the system is slow to respond during swapping, the usual problem is the disk time.
(1) Even worse with swap, there's no command to clean up unused swap
Disabling and then enabling swap is a valid and safe technique, if you want to trigger and w... | Why Linux does not clean up disk caches and swap automatically? |
1,462,218,184,000 |
hdparm -I /dev/sda output:
Logical Sector size: 512 bytes
Physical Sector size: 512 bytes
stat somefile output:
Size: 509 Blocks: 8 IO Block: 4096 regular file
Why IO Block is 4096 ? Isn't it the same as physical sector size which is 512 bytes ?
|
No. The disc block size says, in how big byte chunks is the data handled on the disk. If you write something to a file, your CPU/motherboard has to say to the drive controller, what bytes should be written in which sector of the disc. This can happen only in 512byte chunks.
The distinction between the logical and phys... | Understanding IO Block size |
1,462,218,184,000 |
When the HDD indicator is blinking (for a long period), how could I know which process is taking most disk bandwidth?
|
Using iotop.
Iotop is a Python program with a top like UI used to show of behalf of which process is the I/O going on. It requires Python ≥ 2.5 (or Python ≥ 2.4 with the ctypes module) and a Linux kernel ≥ 2.6.20 with the TASK_DELAY_ACCT CONFIG_TASKSTATS, TASK_IO_ACCOUNTING and CONFIG_VM_EVENT_COUNTERS options on.
| Determine which process is taking most of disk bandwidth? |
1,462,218,184,000 |
I have just tried upon tweaking the badblocks utility to use more RAM and possibly achieve a bit higher performance.
The exact command I am running is (without HDD's S/N):
badblocks -v -b 4096 -c 98304 -w -s /dev/disk/by-id/ata-WDC_WD5000LPCX-24C6HT0_SN >> /root/spare-hdd-badblocks.log 2>&1 &
I do not use the badbloc... |
The -c flag controls the number of blocks tested in one go. By increasing this number you're reducing overhead (system calls), marginally improving performance. (Consider dd vs dd bs=64M as another example of this optimisation process.)
However, I'm less convinced that badblocks is even relevant these days. Disk firmw... | Speeding up `badblocks` by tweaking its `-c` switch |
1,462,218,184,000 |
I have a 3 years old server with two same disks.
I'm planning to replace both before they fails.
Can I add two more new disks to the raid and (after it has been rebuild) eventually remove the two old ones?
Or which is the best way to do this?
Thank you
|
So assuming you are using mdadm you can do exactly what you suggest The only caveat is that the raid monitoring utility will generally only handle one disk at a time and normally when you have marked one as failed. Further you just need to ensure that it has completed copying the data before removing the old disks fro... | Replace both disks in a raid 1 mirror |
1,462,218,184,000 |
In some programs percentage of copying large files get to 100% very fast and then I'm waiting much more before it goes next step.
It's caused by buffer. How to I see amount of data that are going to be written?
|
The term for that is "dirty" data (data that has been changed, but not yet flushed to permanent storage).
On Linux you can find this from /proc/meminfo under Dirty:
$ cat /proc/meminfo | grep Dirty
Dirty: 0 kB
| How to get size of data that haven't been written to disk yet? |
1,462,218,184,000 |
I've added a fibrechannel disk to a RHEL 5.5 server. The disk is present and shows under /dev/sdxx - But I need to give udev a kick and have it refresh the /dev/disk/by-label/LABEL links; this is where I do my mount points.
I do not want to reboot the system.
|
Try udevtrigger. That should replay all outstanding udev-tasks.
| RHEL 5.5 - Need to refresh /dev/disk/by-label links |
1,462,218,184,000 |
when we run the smartctl -a on disk
we get a lot of output
what is the final status that indicates that disk is bad or good?
smartctl -a /dev/sdb
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.10.0-327.el7.x86_64] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF IN... |
The overall health status is that part of the output of smartctl -a that addresses the global question
Is the drive good or bad?
best. In your cited output, that status is reported in the line
SMART Health Status: OK
which can also be obtained separately (with some header) by using the -H option of smartctl, inste... | what is the indications from smartctl that show bad status from disk |
1,462,218,184,000 |
in my bash script I use the syntax lsblk | grep sd in order to capture all disk in my HW machines ( not include flash card or rom )
I just worry that some disk device name will be diff from sd , and I will missed these disks
is it possible ?
lsblk | grep sd
sda 8:0 0 150G 0 disk
├─sda1 ... |
Most disk drivers use the sd prefix, but not all. Historically sd stood for “SCSI disk”, but most disks use a protocol which is close to SCSI, and most of Linux's disk drivers use the generic sd layer plus a controller-specific part. However, this is not an obligation, so you need to check with your hardware. For exam... | Do all disks devices in my HW machines start with - sd? |
1,462,218,184,000 |
Under the /sys/class/scsi_device folder I have the following:
root@linux01:/sys/class/scsi_device # ls
1:0:0:0 2:0:0:0 2:0:1:0 3:0:0:0
How can I know how each of these devices is related to the disk?
For example, how can I determine if device 2:0:1:0 is disk /dev/sdb?
root@linux01:/sys/class/scsi_device # sfdisk... |
An easy way to get the correspondence is to look at the device/block subdirectory in the /sys hierarchy:
# ls -1d /sys/class/scsi_device/*/device/block/*
/sys/class/scsi_device/1:0:0:0/device/block/sr0
/sys/class/scsi_device/2:0:0:0/device/block/sda
/sys/class/scsi_device/2:0:1:0/device/block/sdb
/sys/class/scsi_devic... | Correspondence between SCSI device entries in /sys and the disks in /dev |
1,462,218,184,000 |
I'm writing some automation scripts for full disk backups and I'd like to be fairly precise with which devices are used.
I know that one can uniquely identify a partition using UUIDs and blkid, but is there a way to uniquely identify a disk?
My use case is that I'm not entirely sure which order disks will be mounted ... |
See if it's in /dev/disk/by-id/ which contains links to devices and partitions including brand and serial number.
For example /dev/disk/by-id/ata-WDC_WD15EARS-00MVWB0_WD-WMAZA1856149-part1.
If knowing the /dev/sdX name is important, you can get it with readlink.
$ readlink -f /dev/disk/by-id/ata-WDC_WD15EARS-00MVWB0_W... | Uniquely identifying a drive (not a partition) |
1,462,218,184,000 |
I have a physical server with 2 disks, sda and sdb. I want to monitor their I/O and performance. The monitoring element has 3 types: ops, sps, and bps. What are these and which one is better to monitor and give me useful information?
|
ops = operations per second
sps = sectors per second
bps = bytes per second
More information at https://www.zabbix.com/documentation/2.0/manual/config/items/itemtypes/zabbix_agent
They each give good information. Which one is appropriate in your environment will depend on your requirements.
| Disk Performance Monitoring [closed] |
1,462,218,184,000 |
I want to set disk quota (limit maximum space used in the file system) that a particular process can use under Linux. There seems to be plenty ways to limit disk quota for a user, but not at a per process granularity. One way I can think about is creating a user for each process but as you can imagine that is not a gr... |
Handling it with different user accounts may well be the only possible way since processes do not own any files and can therefore not have a disk quota.
To make it even clearer, at the very best you could manage a quota for the files currently used, should you develop such a kernel patch, but it would still lose its s... | How to set per process disk quota? |
1,462,218,184,000 |
I was brushing up and diving deeper into filesystem anatomy and in numerous resources it is said to be a requirement that the very first superblock start at an offset of 1024 bytes. I started looking for any sort of documentation as to why 1024 was chosen, it just seemed pretty arbitrary. All I could find was the foll... |
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 ... | EXT filesystem family: Why does the first superblock start at offset 1024? |
1,462,218,184,000 |
I'm pretty sure the Linux kernel has a feature which allows to track all the reads and writes (IO) of an application and all its children however I haven't seen any utilities which can calculate it and show it.
For instance for CPU time you could simply use time and get neat CPU use information:
$ time cat --version >... |
I came across this post and found it very interesting. I thought this problem was not that difficult since the question you are asking is quite natural after all.
I could only find an imperfect and incomplete solution. I decided to post it anyway, as the question was not answered yet.
This requires a system with syste... | Utility to show disk IO read/write summary for a task/command/program |
1,470,498,701,000 |
While an application is running, I can monitor disk bandwidth usage using linux tools including dstat.
Now I'd like to know how many sequential or random disk I/Os are occurring in the system.
Does any one know any ways to achieve this?
|
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... | Is there a way to monitor disk i/o patterns? (i.e. random or sequential i/o?) |
1,470,498,701,000 |
is there a command on Linux to remove a file but zeroing it's contents first?
so if i do, something like this:
rm -rf /var/cache/pacman/pkg/*
it would overwrite each file on that directory with 0 values, then erase it
i need it for compacting my VMware image files without creating super big file containing zeros firs... |
The shred command can zero out a file. To do what you want, I think something like this should work
find /var/cache/pacman/pkg -type f -exec shred -n 0 -z {} \; \
&& rm -rf /var/cache/pacman/pkg/*
| How can I zero files out inside a VMware image file so that their space can be reclaimed? |
1,470,498,701,000 |
I have a disk mounted to VM without as a whole. I created a file system on that disk. It has no partitions. Now, I resized the disk from 100G to 200G. Do I need to do anything else to let the file system to make full use of the disk size?
For file systems on some disk partition, we need to update the size of the parti... |
You will need to verify that the kernel has recognized the new size, by e.g. running fdisk -l /dev/<device> or cat /sys/block/<device>/size and checking that the total size matches the new size instead of the old one. If you are using paravirtualized drivers in a VM, most of them will handle this automatically.
But if... | How to resize a disk without partition? |
1,470,498,701,000 |
I am using Fedora 16. My /dev/sda2, mounted on / (root) with something like 50G got filled 100%:
[foampile@~ 13:13:39]> df
Filesystem 1K-blocks Used Available Use% Mounted on
rootfs 51606140 49025452 0 100% /
devtmpfs 2988452 0 2988452 0% /dev
tmpfs 2999424 ... |
Q1. Try something like sudo du -a -m -x | sort -k1n -r | head -n40. The -a flag to du says to be recursive. The -m flag displays sizes in MB. The -x stays on a single filesystem. This will list both files and directories, and only the 40 largest (because of the -n40 option to head). Some du implementations have a -t S... | Disk size management |
1,470,498,701,000 |
The output yielded by df consistent with lsblk
debian8@hwy:~$ df -h /dev/sda1
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 47G 34G 14G 72% /media/xp_c
debian8@hwy:~$ df -h /dev/sda3
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 92G 36G 52G 42% /
The output yield... |
There's actually two problems. The first is the obvious one that others have pointed out: lsblk lists disk by device and df works on mounted filesystems. So lsblk /dev/sda3 is roughly equivalent to df -h / in your case since /dev/sda3 is mounted on /.
Except that it's not. Because lsblk lists the size of the partition... | why df get result inconsistent with lsblk? |
1,470,498,701,000 |
If I dd my disk and compress the image with lzma or lzo the image is still big. The partition is 10GB used, 90GB available. But the image still around 20GB. I believe that is because I have copied many and deleted many files on that disk and the filesystem doesn't zero the unused blocks from those deletions.
How can ... |
The tool you think you're looking for is zerofree, as described in this duplicate question Clear unused space with zeros (ext3,ext4), and already available in most distributions.
However, you seem to be asking how to take an image backup of a filesystem that excludes unused blocks. In this instance use fsarchiver, as ... | How can I zero the unused blocks on my filesystem in order to minimize the compressed disk image size? [duplicate] |
1,470,498,701,000 |
I'm trying to divide a USB thumb-drive into multiple partitions using gparted, but for some reason the Delete option is greyed out. How come?
The drive is unmounted, but the only available option is to resize (which fails). The screenshot didn't want to include drop-down menus for some reason.
I guess I can get around... |
You don't have a partition table on the device, the entire sda drive is formatted to NTFS. If you want to create multiple partitions on it, you first need to create a partition table with Device -> Create Partition Table (note this will destroy the existing NTFS filesystem so if you have some data on it you need to ma... | How come I can't edit the partitions of this USB drive? |
1,470,498,701,000 |
There are several hard disk partitions on my system (Linux josDeb 4.9.0-8-amd64 #1 SMP Debian 4.9.144-3.1 (2019-02-19) x86_64 GNU/Linux). It is working with:
bejo@josDeb:~$ ls -l /dev/disk/by-uuid
yields:
total 0
lrwxrwxrwx 1 root root 10 Apr 13 16:20 00FB-604A -> ../../sdb1
lrwxrwxrwx 1 root root 10 Apr 13 16:19 442... |
Actual UUIDs are supposed to be 128-bit long and meant to be unique. Prior to this, various systems provided various serial numbers of various size to be distinguishable. So Linux just takes whatever serial it can find and sticks them in the /dev/by-uuid/ directory even if they aren't matching the UUID definition. Tha... | Short and long uuids under /dev/disk/by-uuid |
1,470,498,701,000 |
I can't boot my Debian 9.5 with following errors. If I remember correctly ACPI Errors were shown every time I turn on PC. But computer always boot right with these errors, so I didn't care much. The new error starts at "A start job is running.."
When did the error start?
I was going to sell my older HDD so I erased ... |
Systemd assumes certain mounts are critical to the system and as such a failure to mount one results in it switching to emergency mode.
Systemd should have reconfigured its automount units when the device was disconnected unless it appears in /etc/fstab or you configured it as a mount unit. So the issue is likely that... | Trouble on Debian boot up "Timed out waiting for device dev-disk..." |
1,470,498,701,000 |
Here is my lsblk -a list:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 10G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 9G 0 part
├─cl-root 253:0 0 8G 0 lvm /
└─cl-swap 253:1 0 1G 0 lvm [SWAP]
sdb 8:32 0 16G 0 disk
sr0 ... |
(On a previous question) I suggested that you want to remove the DRBD device, however running rm on nodes in /dev/ does not really achieve this. E.g. you should see that the kernel view of block devices in /sys/class/block is not affected by such changes.
Removing the device node will hide it from lsblk, but it would... | How to remove a block device from lsblk list on CentOS 7? |
1,470,498,701,000 |
Have a Debian-based Linux that has been hardware cloned a few times. There are long boot delays even though it has an SSD.
Originally, there had been a little slowly spinning icon saying it was waiting for a job before it timed out. For this, I found a swap file referenced in /etc/fstab that didn't actually exist ... |
Happens after deleting the swap partition
If a swap partition is deleted (e.g. on purpose when migrating from HD to SSD), the file /etc/initramfs-tools/conf.d/resume should be either completely empty or read RESUME=. Delete any UUID number. RESUME=NONE is not valid.
$ sudo gvim /etc/initramfs-tools/conf.d/resume
The ... | Long Boot Time (SSD), black screen with blinking cursor, "gave up waiting on suspend/resume device" |
1,470,498,701,000 |
I am having issues with Seagate Laptop SSHD 1TB, PN: ST1000LM014-1EJ164-SSHD-8GB.
dmesg | grep ata1:
says this:
[ 1.197516] ata1: SATA max UDMA/133 abar m2048@0xf7d36000 port 0xf7d36100 irq 31
[ 6.548436] ata1: link is slow to respond, please be patient (ready=0)
[ 11.232622] ata1: COMRESET failed (errno=-16)... |
Since the issue is with the link, rather than an actual error reported by the drive itself, technically it means that either the SATA port, or the SATA cable, or the drive is having issues. In all likelihood though the drive is dead. (But try another cable if you have one!)
| Did this drive die? |
1,470,498,701,000 |
I'm trying to monitor disk activity of each process. One way that I found how to do this is to read /proc/pid/io file and compare fields with previous read. That works fine except my monitoring process seem to be able to read only some io files (for example it has no permissions to read apache's). How to read io of ot... |
Use iotop.
It should be available in your repo for a Redhat/Centos/Fedora machine (if it is not already installed).
It outputs a similar info as top, but instead of the CPU/memory stats, you will get the IO stats (Disk reads, writes and swapin).
The options -p , -u and --only might be of interest to you.
For example,... | how to read any process' /proc/pid/io |
1,470,498,701,000 |
I am looking for a way to compress swap on disk. I am not looking for wider discussion of alternative solutions. See discussion at the end.
I have tried...
Using compressed zfs zvol for swap is NOT WORKING. The setup of it works, swapon works, swapping does happen somewhat, so i guess one could argue it's technically... |
I don't have a concrete answer for you: something you might explore is LVM.
LVM is primarily an alternative form partitioning. However technically LVM's physical volumes can be any block device. It provides logical block devices ultimately backed by physical ones.
Since LVM logical volumes are block devices they can... | How to compress disk swap |
1,470,498,701,000 |
We are thinking about to change all Linux fstab configuration to work with UUID instead the current configuration
Some of the disks are with non RAID and some of the disks are with RAID10
I searched in google and find complain about using UUID for RAID1 :
" Unfortunately you MUST NOT use UUID in /etc/fstab if you use ... |
Answer to your second question: an UUID allows you to uniquely identify a device.
Devices are assigned as /dev/sda, /dev/sdb, etc. depending on the order the system discovers them. While the drive the system boots on is always the first, for the others their name assignment depends on the order of discovery and might... | in which cases it will be problematic to configure UUID in fstab |
1,470,498,701,000 |
We have 3 servers, each of which are running RHEL 7.6. Each machine has 64G of RAM and 15 CPUs.
We are preparing to install a set of services --- kafka, zookeeper, schema registry --- on all of the machines. Each service is based on a docker container.
We are planning to install docker on all machines, and each mach... |
I'll answer this from the theoretical standpoint, I don't have the experience with Kafka on Docker.
Docker is largely an isolation technology NOT a virtual machine. This means that it is much lighter weight than you might expect. A large portion of it is built around namespaces and mounts including bind mounts.
It w... | Do docker container cause slow Disk/OS performance |
1,470,498,701,000 |
I'm using Fedora server and I have an unused partition on /dev/sda. How can I find it with parted or another command? I can only list mounted and used partitions.
|
with parted you can see unallocated space if you use print free parted command, like parted /dev/sda print free.
Or issue parted /dev/sda command, and then inside parted type print free.
Example
# parted /dev/sda
GNU Parted 2.1
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) prin... | How to find unallocated disk partition with parted or another tool? |
1,470,498,701,000 |
I am testing my new PCI-E SSD in Linux.
I am using the following command to test its performance
(reference: https://www.thomas-krenn.com/en/wiki/Linux_I/O_Performance_Tests_using_dd)
(1) dd if=/dev/zero of=/dev/nvme0n1 bs=1M count=2048 --> 2.2GB/sec
(2) dd if=/dev/zero of=/dev/nvme0n1 bs=1M count=2048 oflag=direct -... |
I would quibble over your wording.
I would say that commands (1) and (2) are over-writing the filesystem,
if any; i.e., ignoring it and destroying it (if there is one).
They will behave the same if the device has a filesystem on it before hand
or not.
Meanwhile, commands (3) and (4) are writing into the filesystem,... | Performance differences when writing into /dev/sda and into /mnt/sda/tempfile |
1,470,498,701,000 |
I was using ext4 filesystems for a long time, and it's the first time I see a weird behavior of ext4 filesystem.
There is ext4 filesystem in /dev/dm-2
An I/O error happened in the underlying device, and the filesystem was remounted read-only. It is fine and expected by the configuration.But for some unknown reason, no... |
Disclaimer: I can't and won't explain in this answer why a kernel partial failure was triggered. This looks like a kernel bug, possibly triggered by the I/O error conditions.
TL;DR
Having a filesystem still in use can happen when a new mount namespace inherits a mounted filesystem from the original mount namespace, bu... | Why a filesystem is unmounted but still in use? |
1,470,498,701,000 |
I used dd to clone a smaller disk onto a larger disk, however now when booting I'm getting dmesg errors of:
[Fri Sep 30 11:48:43 2022] GPT:Primary header thinks Alt. header is not at the end of the disk.
[Fri Sep 30 11:48:43 2022] GPT:1953525167 != 3907029167
[Fri Sep 30 11:48:43 2022] GPT:Alternate GPT header not at ... |
You don't need to do anything special, just use p to print information about the disk, parted will tell you the partition table is wrong and ask you what to do so simply tell it to Fix it:
# parted /dev/loop0
GNU Parted 3.5
Using /dev/loop0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p ... | Fix GPT after using dd to clone a smaller disk onto a larger disk |
1,470,498,701,000 |
My objective is to free some space from the lvm and create new partition.
Below is the devices and lvm ontop of it.
# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda 252:0 0 200G 0 disk
|-vda1 252:1 0 512M 0 part /boot
`-vda2 252:2 0 199.5G 0 part
|-vg-lv_... |
First, you need to reduce the size of the physical volume, using pvresize:
pvresize /dev/vda2 --setphysicalvolumesize 132g
This ensures that all the data and metadata end up inside the first 132GiB of /dev/vda2. I’m playing it safe size-wise here.
Then you need to shrink the /dev/vda2 partition entry, using fdisk or ... | reduce lvm space and create new partition |
1,470,498,701,000 |
I can usually see this log in dmesg:
sd 5:0:0:0: [sda] Attached SCSI disk
Can you please explain what are these 4 numbers?
Will these numbers change after reboot? or it should be constant?
|
The four numbers represent a SCSI address, often referred to as H:C:T:L. The four components are host, channel (or bus), target, and LUN.
With drives you’re likely to encounter on an end-user system (SATA, consumer NVMe, USB), the channel, target, and LUN will all be zero. The host number will depend on which port the... | sd 5:0:0:0: [sda] Attached SCSI disk, what are these four numbers? Will they change? |
1,470,498,701,000 |
In some cases when we are not near the HW Linux machine, we are only able to see disks as the following:
/dev/sdd 20511312 199536 20295392 1% /grd/sdd
/dev/sdb 20511312 487852 20007076 3% /grd/sdb
/dev/sde 20511312 91572 20403356 1% /grd/sde
/dev/sdf ... |
You can try hdparm -i {device}, like:
# hdparm -i /dev/sda
/dev/sda:
Model=SAMSUNG MZ7TD512HAGM-000L1, FwRev=DXT05L0Q,
SerialNo=S151NYADA01701
Config={ Fixed }
RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=0
BuffType=unknown, BuffSize=unknown, MaxMultSect=16, MultSect=16
CurCHS=16383/16/63, CurSects=1651... | how to know if disks are from Jbod or integral as part of the HW machine |
1,470,498,701,000 |
From last 2 weeks I have problem with my SSD in GNU/Linux. I think it's not device problem but I'm not sure.
From time to time (every 1-2 days last days) I loss physical access to the disk, as if it was disconnected or powered off.
The error:
EXT4-fs error (device: sda2): ext4_find_entry:1465: inode #1308161: comm Ne... |
I think I've fixed this by removing SDD, blowing air into M.2 connector and reinserting it back.
When I booted to rescue Debian from USB I've noticed more detailed kernel debug information. While searching I've noticed most solutions were to replace SATA cables. Laptop M.2 connection has no cables.
I'm posting screen
... | random SSD turn off - ext4_find_entry , reading directory lblock0 |
1,470,498,701,000 |
I was reading Fast File System for UNIX where it says the following on page 3:
By ‘‘partition’’ here we refer to the subdivision of physical space on
a disk drive. In the traditional file system, as in the new file
system, file systems are really located in logical disk partitions
that may overlap. This overlap... |
Keep in mind that the text you are reading is from about 35 years ago, and while many of the characteristics of the "Fast File Systems" have survived e.g. in ext2, I assume you are doing that to study the history.
Disks are divided into sectors (physical blocks) which are necessarily consecutive.
Sort of. Physicall... | FFS: Logical and Physical Blocks in Partitions |
1,470,498,701,000 |
After removing a bay mounted SATA connected drive the kernel will most of the time remove the mount. However, sometimes the mount remains even though the disk has been removed. Is there a way to avoid this?
|
As I ended replied to the original OP, you can always force an unmount with a lazy unmount
umount -l <filesystem|partition>
Nevertheless the thing about lazy umount is that it ignores the pending buffers to be written to that drive.
I would recommend a script a sudo for the user or a group of users that run the app, ... | Hot Removed SATA drive mount remains |
1,470,498,701,000 |
i'm new and i hope to find an answer here. Please tell me, if you need more information.
I have an disk encryption for my home partition on Linux 4.13.0-43-generic x86_64 (Ubuntu 16.04.4 LTS).
Today when I started the laptop, I got the message, that my disk is full and there is no available space any more. With the di... |
/home/.ecryptfs/bianca/.Private contains the encrypted versions of all your home files, when you're logged in they're decrypted on-the-fly to your home (~ or /home/bianca). It should be approximately the same size as your home when you're logged in. Delete (or backup/move) some files out of your home, not directly fro... | Disk encryption with ecryptfs - full disk |
1,470,498,701,000 |
I've been looking around and I found out that you can find your disk space with df -hT. So I did use it to get the disk space (in total) and how much is left.
But the thing is, I wonder if there are any other ways to get the information?
The code I copied here, will give total disk space in GB's (I added the B in the ... |
Removing the backslash works for me:
df -hT /home | awk '{print $3}' | awk 'FNR == 2 {print $1 "B"}'
and can be simplified to
df -hT /home | awk 'FNR == 2 {print $3 "B"}'
| Linux disk space |
1,470,498,701,000 |
I had an Ubuntu 14.04 running on a 1024 GB disk (disk A), which only used up to 130 GB spaces. I want to clone it to a 256 GB SSD disk ( disk B ). But failed.
I used gparted to shrink the partitions on disk A to be only about 180 GB for the preparation for disk B successfully.
Can you tell me where I was wrong?
1) res... |
I am not familiar with sfdisk, but you could accomplish the same thing, partition table AND MBR back up using dd.
This was in my notes and I am not the author...
Backing up the MBR
The MBR is stored in the the first 512 bytes of the disk. It consist of 3 parts:
The first 446 bytes contain the boot loader.
The next 64... | How to shrink, clone an entire Linux disk and boot it? |
1,486,330,371,000 |
Midnight Commander uses virtual filesystem (VFS) for displying files, such as contents of a .tar.gz archive, or of .iso image. This is configured in mc.ext with rules such as this one (Open is Enter, View is F3):
regex/\.([iI][sS][oO])$
Open=%cd %p/iso9660://
View=%view{ascii} isoinfo -d -i %f
When I press En... |
This question is ancient, but I found myself wanting something similar, and found a possible solution (no one stop shop, but a way to solve it).
See https://stackoverflow.com/questions/66754449/list-contents-of-floppy-image-file-without-mounting-in-linux?noredirect=1#comment118002316_66754449
Basically you'll need to ... | midnight commander: rules for accessing archives through VFS |
1,486,330,371,000 |
How to get total disk read/write in bytes per hdd device?
for example if i have sda, sdb, and sdc, is there any file on /proc that i could use similar to /proc/net/dev for networking?
|
found it..
/proc/diskstats
the 6th and 10th columns are respectively read blocks and write blocks, to get the value in bytes, multiply with 512..
/sys/block/sdX/stat
the 3rd and 7th values are respectively the same as above
| How to get total disk read/write in bytes per hdd device from /proc |
1,486,330,371,000 |
I have three identical servers, all three same cabeling and correctly placed hard-disk. Allthough one of the server got /dev/sdg /dev/sdh for the sata-ssds while the other two servers got them on /dev/sda /dev/sdb - Im using Proxmox with ZFS.
The SATA-SSDs are connected onBoard (SATA-Cabeling to Board) while the Hard-... |
The /dev/sd* names are simply assigned in detection order, which may vary from one boot to the next if storage driver module loading order is not exactly the same each time, or if disks are plugged or unplugged. The current wisdom is to use something else in your configuration:
in /etc/fstab, you could use the UUID= ... | How does Debian or Linux in general assign device-names like /dev/sdX on ZFS? |
1,486,330,371,000 |
I've to create a new volume group of 5G with lvcreate but the disk don't have enough space disk :
lvcreate -n lv_new -L5G VGroup
Volume group "VGroup" has insufficient free space (1279 extents): 1280 required.
How to modify the lvcreate command for extend of 1279. I don't know if I've to put a suffix like K for ki... |
You can just, instead of specifying the size using -L, tell lvcreate to use 100% of the free extents, or use a specified number of extents using -l; instead of -L5G, try -l 1279 to use the remaining 1279 extents, or -l 100%FREE to use all remaining free extents (which seem to be 1279).
| How to know the suffix of size in lvcreate |
1,486,330,371,000 |
Ubuntu linux: ls -s disagrees with du & stat for the number of blocks used by a small file.
ls -s ../nc2/.git/logs/refs/heads/
total 4
du ../nc2/.git/logs/refs/heads/
8 ../nc2/.git/logs/refs/heads/
stat ../nc2/.git/logs/refs/heads/
File: ‘../nc2/.git/logs/refs/heads/’
Size: 4096 Blocks: 8 ... |
ls -s reports the st_blocks member of the structure returned by the stat()/lstat() system calls. That's a number 512-byte blocks. 512 bytes is usually the minimum storage granularity as that corresponds to early disk sectors.
Or at least that's what most ls implementations do including the original Unix implementation... | ls -s uses wrong block size |
1,486,330,371,000 |
Good evening,
I installed ArchLinux on a USB stick, and I would like to boot it in qemu. Unfortunately, most examples I found boot an image (iso..).
The stick is definitely bootable as if I restart my computer, it shows a grub that can successfully start ArchLinux.
I have tried things such as
sudo qemu-system-x86_64... |
What kind of errors do you get?
Ex:
user@marconi ~ $ sudo qemu-system-x86_64 -usb -usbdevice disk:/mnt/usbdrive
qemu-system-x86_64: -usbdevice disk:/mnt/usbdrive: could not open disk image /mnt/usbdrive: Is a directory
qemu: could not add USB device 'disk:/mnt/usbdrive'
If you see something similar, the problem is th... | start qemu by giving it a path to a linux root |
1,486,330,371,000 |
If I need to use a my USB drive on an Ubuntu machine I need to mount it first.
If my USB device is /dev/sdb1 then I mount it with:
mount /dev/sdb1 /home/some_folder
Then use /home/some_folder to read and write data to the USB drive.
But tools like dd can work directly with the device without a mounting point:
dd if=/... |
You can use your USB without mounting it. You can use dd or other tools to copy data to it, and copy data from it. It is also common to use storage devices as swap space without mounting them.
"Mounting" means attaching a filesystem that resides on a separate storage device to a currently mounted filesystem. This requ... | Why some tools such as dd don't need a mount point to work with a device? |
1,486,330,371,000 |
One of my attached disks had xfs filesystem. I formatted the disk to ext4 using:
sudo mkfs.ext4 /dev/sdc1
Now when I run sudo -i blkid, I get this output:
/dev/sdc1: UUID="df722345-7e80-4a08-8da1-e6046cc2b0e1" TYPE="ext4" PARTLABEL="xfspart" PARTUUID="1df243b5-2b64-4c39-bd45-4cb31d7ff58e"
I can see that the PARTLABE... |
The PARTLABEL is a property of the partition table (GPT), unrelated to partition content (any filesystem or lvm, luks, raid, etc.). Thus it's not overwritten when you mkfs partition content.
If you are not using this value for anything, you can ignore it since it means nothing. Or, to avoid confusion, you can change i... | Does "PARTLABEL" affects fstab behavior in Ubuntu16.04? |
1,486,330,371,000 |
I'm using dd to overwrite my hard drive with zeros (before I recycle my laptop).
Several minutes into running, the visual display was replaced with a black background and a flashing cursor in the top left of the screen.
No text is being written to the screen, so it's not clear to me whether dd is still running or how ... |
When dd has written the device full it will output a message:
dd: writing to '/dev/full': No space left on device
Sending USR1 signal to running dd process makes it output the current status. You can use kill to send the signal:
kill -USR1 $PID
More recent versions of GNU dd have an option status=progress which will... | How can I tell whether dd is done erasing my hard drive? |
1,486,330,371,000 |
I am using GParted (0.28.1, Fedora 25) to format a external drive and noticed that the command displayed is:
mkfs.ext4 -F -O ^64bit -L "INSTALL" /dev/sdd1
When making disks in the past from command line I have just used mkfs.ext4 DEVICE which seemed to work well for various architectures. However the above includes ... |
The default options for mke2fs including those for ext4 can be found in /etc/mke2fs.conf. They could be different depending on the distro you're using. I'd take a look at that file on any distro you're curious about to see if the -O ^64bit param would be necessary. According to the man page the '^' is indeed the prefi... | What does this mkfs.ext4 operand mean? |
1,486,330,371,000 |
On a CentOS 5 server:
fdisk -l 2>/dev/null
shows many /dev-dm-XX disks.
/proc/mdstat is empty, so they are not software RAIDs
ps -ef | grep -i multipath | grep -v grep and multipath -ll shows NOTHING! So they are not disks from multipath.
all have an old "last modification timestamp: 1 year ago
strings $(/dev/dm-1... |
How do you think you are mounting your filesystem(s)?
$ findmnt /
TARGET SOURCE FSTYPE OPTIONS
/ /dev/mapper/alan_dell_2016-fedora ext4 rw,relatime,seclabel,data=ordered
$ ls -l /dev/mapper/alan_dell_2016-fedora
lrwxrwxrwx. 1 root root 7 Mar 14 09:53 /dev/mapper/alan_dell_2016-fedora... | What are these DM devices? |
1,486,330,371,000 |
The thing is that the owner had Windows 10 already installed and the disk was formatted with the dynamic layout (on MBR scheme). Windows shows that there are 4 existing volumes (C, D, E, F) but Gparted (On a live Linux) doesn't show the last three partitions (D, E, F) as separate partitions, instead it shows them as o... |
The problem is support for Windows' Dynamic disk format under Linux is weak. The Windows' Dynamic disk partitions won't show up under Linux until a tool like ldmtool
is installed (which reads the metadata and maps them as device mapper disks). However your typical Linux distro installer is not going to run it and thu... | How to install Ubuntu on a Windows dynamic disk (MBR scheme)? |
1,486,330,371,000 |
Has anyone seen this issue that can help me solve it? I have got a preinstalled server (Debian GNU/Linux 7.6 (wheezy)), where the disk space was partitioned very badly... :-( The Hardisk is very big but it is partitioned this way:
rootfs 323M 320M 0 100% /
udev... |
In order to recover this installation, I suggest:
download & boot RIP Linux (11.7 is a version I prefer, although there is 13.7 available too); if you have problems booting the ISO, remember that for RIP Linux is enough to start the kernel and rootfs.cgz as initrd, making it very simple to boot even from an existing ... | full rootfs on big hardisk, installation or update software not possible |
1,486,330,371,000 |
Pertaining to computer forensics, if the suspect's computer (which cannot be removed from the scene), is Linux, can you directly use tools such as dd or dcfldd on his computer to acquire the disk image? Or do you need to use forensic live cds like Helix, Penguin sleuth or FFCU on top of the existing OS?
|
While running a command like
# dd if=/dev/sda of=/path/to/external/medium/file.img
on a live system will work, it's going to result in a number of problems which you won't have if you boot into a separate OS and make the image(s) from there:
If you image an entire disk, it probably contains a boot loader and a parti... | How to acquire image of disk on Linux computer? |
1,486,330,371,000 |
I have quite a lot of external hard-drives, and often have a hard time finding what I'm looking for - not to mention not storing the same file several times on different drives or finding free space when I need. I was therefor wondering if there are any database-programs suitable for storing the content of disks; inc... |
It sounds like what you want is some sort of media content database. There are multiple such available; a few that you may want to have a look at are:
Gnome Catalog
Hyper's CdCatalog
CDCollect
Virtual Volumes View
Since these are primarily meant for cataloging CDs and DVDs, they should have no problem even if the di... | Any programs suitable for making a database over disk-content? |
1,486,330,371,000 |
I'm having strange problems with my PC and don't know what to do. It all started with the fact that certain characters (Devanagari characters) could no longer be displayed in my Emacs. Whenever I opened a document containing these characters and then scrolled to the place where the characters were supposed to be displ... |
The messages in the crash report indicate that the sdb disk had a read error and returned bad data. It says auto reallocate failed, so it might be that any spare capacity to replace detected bad blocks is already used up.
You should run sudo smartctl -x /dev/sdb and see what it reports.
Also, you should definitely kee... | Editors crashing with certain characters, programs crashing, how to diagnoze? |
1,486,330,371,000 |
Model: ATA Samsung SSD 850 (scsi)
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 24576B 1048575B 1024000B bios_grub
2 1048576B 537919487B 536870912B f... |
Try align-check minimal 1, it should be OK with that.
Irrespective of what parted would consider optimal for your hardware, optimizing the partition layout for flash memory should take into account that chips are organized into pages and erase blocks.
You just cannot simply overwrite a page. The processor controlling ... | Parted says not aligned, but should be correct |
1,486,330,371,000 |
As UUID's are assigned in partitioning phase (by software), there is no UUID available for entire disk.
However, /dev/disk/by-id/ contains promising information for the same purpose. We can get the "UUID" path for - eg. /dev/sdb/ by:
$ disk=sdb; ls /dev/disk/by-id/ -l | grep "/$disk$" | awk '{print "/dev/disk/by-id/... |
The wwn- entry is the World Wide Name of the disk. It is technically not an UUID, because it does not follow the UUID format nor generation rules.
On stand-alone SATA and SAS disks, it is reported by the disk firmware and assigned at factory. On SAN storage systems it might be more complicated: as the storage is pres... | How to correctly get the UUID of the entire disk? |
1,486,330,371,000 |
I created a persistent Debian 9 live usb. The persistence is configured with / union. An unexpected consequence, although obvious in hindsight, is the system lags on non-cached reads:
holmes@bakerst:~$ # WRITE to disk
holmes@bakerst:~$ dd if=/dev/zero of=tempfile bs=1M count=1024; sync
1024+0 records in
1024+0 recor... |
Get a faster USB 3 pendrive, or maybe even a USB SSD :-)
You can easily improve reading from the image of the iso file (after a slow start), put all the content of the squash file system into RAM with the boot option toram, but I don't think it is easy or meaningful to do that with the content of the file/partition f... | Speed up persistent live usb disk operations |
1,486,330,371,000 |
As far as I know, in linux systems, when modifying the content of a file, the pages containing the content of the file in page cache will be marked dirty, and will be flushed to disk eventually.
What I'm wondering is that, when these pages are flushed to disk, are they flushed in blocks?
For example, if the block size... |
That's a pretty complex topic, and depends on the disk, the disk controller and kernel settings.
In general, the kernel will attempt to be as efficient as it can. For example, if you update the same block multiple times within an adjustable time window (typically 30 seconds or so), and don't explicitly force syncing a... | Does linux systems flush dirty pages to disk one block by one block? |
1,486,330,371,000 |
I am unpacking a tar file when I have error messages like this:
[xxxxx@lo-login-02 ~]$ tar -xvf ontonotes-release-5.0_LDC2013T19.tgz
...... (omitted lines)
tar: ontonotes-release-5.0/tools/ontonotes-db-tool-v0.999b/src/on/__init__.py: Cannot open: No such file or directory
ontonotes-release-5.0/tools/ontonotes-db-too... |
You have reached the maximum number of files not on the filesystem, but for your usage quota. Delete some files (of any size) and new files will be able to be created.
| Cannot mkdir: Disk quota exceeded, but iNodes and space are far from exceeding |
1,486,330,371,000 |
i got a big problem when i try to boot my VMware OpenBSD 5.7 i got this :
I can see all my data making : cat /root/mydata
they have nothing important for me into sd0k (/home)
i've try fsck etc, the problem stays
what i can do to boot ?
|
At that prompt, press Return to get a root shell.
Then run
# fsck sd0k
This ought to repair the inconsistencies found.
If you have nothing important on sd0k and want to reformat the partition, then, as root, make sure that the filesystem that sd0k contains is no longer mounted, then do
# newfs sd0k
... taking great ... | OpenBSD /dev/sd0k unexpected inconsistency - bad super block |
1,486,330,371,000 |
I know of various ways in which to check when the last fsck occurred on a file system. e.g.
$ sudo dumpe2fs -h /dev/sda1 | grep 'Mount count' -A3
dumpe2fs 1.42.12 (29-Aug-2014)
Mount count: 74
Maximum mount count: -1
Last checked: Thu Dec 11 21:37:56 2014
Check interval: 0 (<non... |
When the partition is in clean state, there is no actual fsck run, which is why the date isn't updated.
If you want to force it, the -f option does just that: sudo fsck -f /dev/sda1.
| How can I tell when my file system was last fsck-ed at all? |
1,390,366,002,000 |
In my laptop (running Linux) I have only one SSD, connected to the SATA3 port.
Why I have two sdx entries in /dev directory?
In particular I see /dev/sda and /dev/sdb, and /dev/sda is the SSD:
# fdisk -l
Disk /dev/sda: 128.0 GB, 128035676160 bytes, 250069680 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector siz... |
With the update (lshw … output) there is the answer now:
product: xD/SD/M.S.
That's your laptop's cardreader. Also, capabilities: removable.
UPDATE:
As for the mentioned /sys/block/sdb/queue/rotational value being 1, this parameter actually influences the I/O scheduling algorithm in Linux. Probably, it should have bee... | Why I have two /dev/sdx entries with a single disk? |
1,390,366,002,000 |
I was flashing a new operating system to a device, but after the process was complete, I couldn't boot into it. I then checked the disk, and I noticed something strange.
Different tools report different sizes for the disk, even though it should be approximately 120GB in size.
So, I decided to:
dd if=/dev/zero of=/dev/... |
By "flashing a new operating system to a device", did you mean writing a complete disk image, including partition tables?
Note that your dd if=/dev/zero of=/dev/sda should have certainly overwritten the DOS-type partition table, but if you did not trigger a rescan of the disk afterwards, the system will still be using... | Disk size is variable |
1,390,366,002,000 |
Due to shortage of free built-in SATA 3.0 plugs (6 totally) on my motherboard (Gigabyte 970A-DS3 rev.3) I've got an Adaptec RAID 5405 (3G SAS/SATA RAID) to move all "slow" SATA 1.0/2.0 devices to be connected to this card without creating any RAID. Adaptec RAID 5405 has one SFF-8087 connector and allows to connect up ... |
There is no possible to expose disk drives directly as block devices through Adaptec RAID controller. Almost all controllers from Adaptec don't support this feature - at least 5405, 5805 and, more general, a whole 3 and 5 series, though no information about 6 series of RAID controllers. Controller's BIOS doesn't allo... | SATA disk drive behind Adaptec RAID 5405 can't be detected as block device |
1,390,366,002,000 |
When I run ras-mc-ctl --summary I get the following output:
No Memory errors.
No PCIe AER errors.
No Extlog errors.
No devlink errors.
Disk errors summary:
0:0 has 15356 errors
0:2064 has 4669 errors
0:2816 has 594 errors
No MCE errors.
Now, I'm not particularly concerned about there errors given that ... |
lsblk will give you MAJ:MIN numbers
To calculate the equivalent for ras-mc-ctl, do:
d = (MAJ * 256) + MIN
To go from ras-mc-ctl to lsblk, do:
MAJ=int(d/256)
MIN=d % 256
For your case:
MAJ=(2064/256)=8
MIN=(2064%256)=16
| Interpret disk errors output from ras-mc-ctl --summary |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.