Linux
HDD Operations
adding a hdd
1 2 3 4 5 |
fdisk /dev/sdx partition olusturma mkfs.ext3 /dev/sdx ile ext3 formati atilir. mount –t ext3 /dev/sdx /disk1 /dev/sdx /disk1 folderina mount edilir. fdisk –l kontrol edilir. mount kontrol edilir. |
NTFS Mount operations
1 2 3 |
cat /proc/ filesystems -- ntfs should be in this output, if it's absent then there could be some problems mount /dev/sdb1 /media/sdb -t ntfs -rw -o umask=0222 (mounts to /media/sdb on disk sdb1) umount sdb -- to cancel the mount |
If the ntfs-3g entry in fstab has been loaded:
1 |
/dev/sdb1 /media/sdb ntfs-3g dmask=022,fmask=133,noauto,locale=hu_HU.UTF-8,user 0 0 |
Low Level Format
1 |
cat /dev/zero /dev/hdX -- alternatively, dd if=/dev/zero of=/dev/hdX |
To view all of hdds in the system
1 |
sfdisk --list |
To only view the directories
1 |
ls -l | grep "^d" |
Copying from a faulty partition (hda) to a healthy partition (hdb)
1 |
dd if=/dev/hda of=/dev/hdb bs=512 conv=noerror,sync |
To view the amount of storage used by the home folder
1 |
du -s /home/* | sort -rn |
Viewing the disk capacity in terms of GB (Gigabytes)
1 |
df -k | grep -vE ' kbytes | : | swap ' | awk ' { t+=$2 } END { print "Total GB: ", t/1000000 } ' |
A dangerous command that could delete the entire system if entered as a root user
1 |
rm -rf / |
Checking whether the disk is stable
1 |
dd if=/dev/hda of=/dev/null bs=64K |
A dangerous command that could delete the entire system if entered as a root user
1 |
rm -rf / |
To format to an ext2 filesystem
1 2 |
mkfs.ext2 /dev/sdx mkfs.ext3 /dev/sdx |
Assigning newly added disks to the dbms
1 2 3 4 |
echo "- - -" > /sys/class/scsi_host/host0/scan echo "- - -" > /sys/class/scsi_host/host1/scan echo "- - -" > /sys/class/scsi_host/host2/scan echo "- - -" > /sys/class/scsi_host/host3/scan |
How to connect...
9 September 2021