Skip to content

Commit 5200ca7

Browse files
committed
Start splitting filesystem
1 parent a151d09 commit 5200ca7

File tree

8 files changed

+106
-57
lines changed

8 files changed

+106
-57
lines changed

README.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,19 @@ Pagers:
5656
- [more](more.md)
5757
- [pg](pg.md)
5858

59-
File and directories:
59+
Files, directories, partitions:
6060

61+
- [badblocks](badblocks.md)
62+
- [blkid](blkid.md)
6163
- [cp](cp.sh)
6264
- [du](du.md)
65+
- [e2fsck](e2fsck.md)
66+
- [e2fsprogs](e2progs.md)
6367
- [fdupes](fdupes.md)
6468
- [find](find.md)
6569
- [locate](locate.md)
6670
- [ls](ls.md)
71+
- [lsblk](lsblk.md)
6772
- [Swap partition](swap-partition.md)
6873
- [tree](tree.md)
6974

badblocks.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# badblocks
2+
3+
e2fsprogs package.
4+
5+
Most useful invocation:
6+
7+
badblocks -nvs /dev/sdb
8+
9+
- `-n`: non-destructive read-write mode. The default is non-destructive read-only.
10+
- `-s`: show progress
11+
- `-v`: verbose information
12+
13+
The output of `badblocks -v` can be used as the input of `e2fsck -l` to mark some blocks as bad and not use them.

blkid.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# blkid
2+
3+
`util-linux` package.
4+
5+
Get UUID, label and filesystem type for all partitions
6+
7+
sudo blkid
8+
9+
Sample output:
10+
11+
/dev/sda2: LABEL="DATA" UUID="E4EEDB25EEDAEF34" TYPE="ntfs"
12+
/dev/sdb1: LABEL="ESP" UUID="9E91-F4F8" TYPE="vfat"
13+
/dev/sdb2: LABEL="DIAGS" UUID="ECC5-8CEC" TYPE="vfat"
14+
/dev/sdb4: LABEL="WINRETOOLS" UUID="0058C6EB58C6DE92" TYPE="ntfs"
15+
/dev/sdb5: LABEL="OS" UUID="4C38CCBD38CCA6F4" TYPE="ntfs"
16+
/dev/sdb6: LABEL="PBR Image" UUID="C2CE5FDBCE5FC677" TYPE="ntfs"
17+
/dev/sdb7: UUID="3fabbe75-0c62-4705-a3ad-4e87c5dcc143" TYPE="ext4"
18+
/dev/sdb8: UUID="56886cc6-e247-488a-9acf-a07a99cfa3ca" TYPE="ext4"
19+
/dev/sdb9: UUID="bbc2c9bf-4846-44d1-81c0-eade6d2dcefb" TYPE="swap"

e2fsck.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# e2fsck
2+
3+
Black list bad blocks so that the OS will not use them:
4+
5+
sudo badblocks -v /dev/sdb > /tmp/bad-blocks.txt
6+
sudo e2fsck -l /tmp/bad-blocks.txt /dev/sdb
7+
8+
TODO: is black-listing a feature of ext filesystems?

e2fsprogs.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# e2fsprogs
2+
3+
Library of ext filesystem utilities.
4+
5+
<http://en.wikipedia.org/wiki/E2fsprogs>
6+
7+
Contains:
8+
9+
- `badblocks`
10+
- `blkid`
11+
- `e2fsck`
12+
13+
Present by default on almost all Linux distributions.

eclipse.md

+2
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ Navigate in editor and its tabs:
6767

6868
- `Ctrl + Shift + R`: find files.
6969

70+
- `Ctrl + Shift + G`: find where the id (class, method, etc.) under the cursor is used.
71+
7072
- `Ctrl + O`: dropdown filter jump to method definition in current file
7173

7274
Search entire

filesystem.md

-56
Original file line numberDiff line numberDiff line change
@@ -371,52 +371,6 @@ CD DVD.
371371

372372
A SanDisk SD card had a device named `mmcblk0`.
373373

374-
### lsblk
375-
376-
List block devices, including those which are not mounted.
377-
378-
sudo lsblk
379-
380-
Sample output:
381-
382-
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
383-
sda 8:0 0 465.8G 0 disk
384-
|-sda1 8:1 0 1.5G 0 part
385-
|-sda2 8:2 0 93.2G 0 part /media/win7
386-
|-sda3 8:3 0 13.7G 0 part
387-
|-sda4 8:4 0 1K 0 part
388-
|-sda5 8:5 0 338.1G 0 part /
389-
|-sda6 8:6 0 3.7G 0 part [SWAP]
390-
`-sda7 8:7 0 15.6G 0 part
391-
sdb 8:16 0 931.5G 0 disk
392-
`-sdb1 8:17 0 931.5G 0 part /media/ciro/DC74FA7274FA4EB0
393-
394-
`-f`: show mostly information on filesystems:
395-
396-
sudo lsblk -f
397-
398-
Sample output:
399-
400-
NAME FSTYPE LABEL MOUNTPOINT
401-
sda
402-
|-sda1 ntfs SYSTEM_DRV
403-
|-sda2 ntfs Windows7_OS /media/win7
404-
|-sda3 ntfs Lenovo_Recovery
405-
|-sda4
406-
|-sda5 ext4 /
407-
|-sda6 swap [SWAP]
408-
`-sda7 ext4
409-
sdb
410-
`-sdb1 ntfs /media/ciro/DC74FA7274FA4EB0
411-
412-
`-o`: select which columns you want exactly. Most useful information for humans:
413-
414-
sudo lsblk -o NAME,FSTYPE,MOUNTPOINT,LABEL,UUID,SIZE
415-
416-
`-n`: don't output header with column names. Good way to get information computationally. E.g., get UUID of `/dev/sda1`:
417-
418-
sudo lsblk -no UUID /dev/sda1
419-
420374
## UUID
421375

422376
Unique identifier for a partition. Field exists in ext and NTFS.
@@ -433,16 +387,6 @@ Get all devices:
433387

434388
sudo lsblk -no UUID /dev/sda1
435389

436-
## blkid
437-
438-
`util-linux` package.
439-
440-
Get UUID, label and filesystem type for all partitions:
441-
442-
sudo blkid
443-
444-
## Label
445-
446390
An ext partitions concept.
447391

448392
Determines the mount name for the partition.

lsblk.md

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# lsblk
2+
3+
List block devices, including those which are not mounted.
4+
5+
sudo lsblk
6+
7+
Sample output:
8+
9+
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
10+
sda 8:0 0 465.8G 0 disk
11+
|-sda1 8:1 0 1.5G 0 part
12+
|-sda2 8:2 0 93.2G 0 part /media/win7
13+
|-sda3 8:3 0 13.7G 0 part
14+
|-sda4 8:4 0 1K 0 part
15+
|-sda5 8:5 0 338.1G 0 part /
16+
|-sda6 8:6 0 3.7G 0 part [SWAP]
17+
`-sda7 8:7 0 15.6G 0 part
18+
sdb 8:16 0 931.5G 0 disk
19+
`-sdb1 8:17 0 931.5G 0 part /media/ciro/DC74FA7274FA4EB0
20+
21+
`-f`: show mostly information on filesystems:
22+
23+
sudo lsblk -f
24+
25+
Sample output:
26+
27+
NAME FSTYPE LABEL MOUNTPOINT
28+
sda
29+
|-sda1 ntfs SYSTEM_DRV
30+
|-sda2 ntfs Windows7_OS /media/win7
31+
|-sda3 ntfs Lenovo_Recovery
32+
|-sda4
33+
|-sda5 ext4 /
34+
|-sda6 swap [SWAP]
35+
`-sda7 ext4
36+
sdb
37+
`-sdb1 ntfs /media/ciro/DC74FA7274FA4EB0
38+
39+
`-o`: select which columns you want exactly. Most useful information for humans:
40+
41+
sudo lsblk -o NAME,FSTYPE,MOUNTPOINT,LABEL,UUID,SIZE
42+
43+
`-n`: don't output header with column names. Good way to get information computationally. E.g., get UUID of `/dev/sda1`:
44+
45+
sudo lsblk -no UUID /dev/sda1

0 commit comments

Comments
 (0)