Disk Operations

From Notepedia
Jump to: navigation, search

Pretty tidy way of viewing all disks, mount points, and their partitions

$ lsblk
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
└─sda3         8:3      0   237.8G  0   part
├─fedora-root  253:0    0   50G     0   lvm   /
├─fedora-swap  253:1    0   2G      0   lvm   [SWAP]
└─fedora-home  253:2    0   185.9G  0   lvm

The classic way

$ fdisk -l
Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x23903cc4

Device     Boot Start        End    Sectors   Size Id Type
/dev/sda1          63 1953118439 1953118377 931.3G da Non-FS data


Disk /dev/sdb: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x00000000

Device     Boot Start        End    Sectors   Size Id Type
/dev/sdb1          63 1953118439 1953118377 931.3G da Non-FS data
...

How full is each partition?

$ df -h
Filesystem                      Size  Used Avail Use% Mounted on
dev                             1.6G     0  1.6G   0% /dev
run                             1.6G  864K  1.6G   1% /run
/dev/sdf2                       109G   18G   85G  18% /
tmpfs                           1.6G  8.0K  1.6G   1% /dev/shm
tmpfs                           1.6G     0  1.6G   0% /sys/fs/cgroup
tmpfs                           1.6G  8.4M  1.6G   1% /tmp

What are the largest folders in this directory?

$ du -h | sort -hr | head

652M	.
198M	./tmp
178M	./wiki.andreacchio.net
125M	./tmp/bluespice-free
119M	./tmp/bluespice-free/extensions
87M	./tmp/bluespice-free/extensions/BlueSpiceExtensions
80M	./thedefenders.xyz
61M	./test.thedefenders.xyz
58M	./tmp/bluespice-free/extensions/BlueSpiceExtensions/ExtendedSearch
57M	./wiki.andreacchio.net/languages