Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
I ran a check on a partition :
sudo e2fsck -c /dev/sdb3
It found some bad blocks. As far as I understood, it marked the badblocks, so that no files will use them.
My question is : is that "marking" persistent or is it linked to the partition ?
More specifically, if I reformat the partition with something like
sudo mkfs.ext4 /dev/sdb3
are the badblocks still marked ?
That marking is part of the filesystem, and thus should be overwritten by the creation of a new filesystem. mke2fs can rerun the badblock check using -c, or you can plausibly extract the list with dumpe2fs -b and read it back in with -l for either mke2fs or e2fsck. Since the list uses block numbers, the block size must be kept the same.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
The top command is live and constantly updating, not generating a permanent result. Can we add an argument for a permanent result (if it exists), or use a different command resulting in a definite and final response?
top -n1
should do the job. If you want to store the output in a file, you should add the -b option for batch mode.
Note that this is just a sample of usage at one time, not anything like a final answers as all the numbers in top vary over time even on the stablest of systems.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
What does the -a option do in the cp command?
I thought that the -a does not preserve the structure of directories. But, I have never found a case where the structure of directories has been destroyed by the -a option.
is there such a case where the structure of directories has been destroyed by the -a option? Thanks.
-a means 3 things:
preserve timestamps, permissions, group, user (if you're running as root).
preserves symbolic links (no dereference)
recursive copy
read the man page, it has all info there
-a, --archive
same as -dR --preserve=all
To my understanding, it should recursively copy the directories while keeping all the attributes. In which case, it shouldn't be destroying the structure at all.
http://man7.org/linux/man-pages/man1/cp.1.html
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
When practising cgroup, we need mount like mount -t cgroup -o cpuset none /cpuset
Would you explain the significance of none here?
Seems it's just a name and I could set it as any string, right?
Is there any file, folder or file contant based on it?
Certain filesystems aren't associated with a physical device (such as a partition or network share, which is what is expected at that point in the mount command) and it is/was customary to use none for these. I've seen a more reasonable approach, using a more descriptive name, eg. cpuset in your case.
Cheers,
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
By safety I mean if the transfer gets interrupted, how does that impact the data in both source and dest? Is it also dependent on the specific types of filesystems?
When working across filesystems mv really has no choice but copying the file, in effect doing whatever cp does and then unlinking the original file.
A simple strace shows this:
rename("/tmp/file.rand", "./file.rand") = -1 EXDEV (Invalid cross-device link)
^^^^^^^^^^^^^^^^^^^
After this point mv reads 65536 bytes at a time from one fd and writes them to the other and does an unlinkat at the end.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
As far as I know, du or df can be used in MOUNTED partition only. I don't want to mount them, but I wanna know their usage, What command I can peek that info?
you can try
tune2fs -l /dev/sdx (your unmounted parition)
or
parted /dev/sdx print al
Untested but GNU df supports --direct. I don't have access to any linux at the moment. But give it a try.
df --direct /dev/sda2