Linux Bootcamp Series (Device Management) – 26/Jan/2020

Linux Device Management

Preview

  • Udev identifies new hardware and adds the entry of the hardware in the /dev folder

Linux File Soft and Hard Links

Exercise for Soft and Hard links

  • Basic Setup
mkdir contents
cd contents
echo "hello world" >> text1.txt
echo "welcome to linux" >> text2.txt
ls -al .
cd ..
mkdir links
cd links
ln -s ../contents/text1.txt softtext1.txt
ln ../contents/text1.txt hardtext1.txt
ls -al .
  • Delete the source and verify the links
cd contents/
rm text1.txt
cd ../links
cat softtext1.txt # This command will fail 
cat hardtext1.txt
  • Create a softlink and a hardlink for text2.txt
    • Change the contents using the softlink and hardlink

inodes

  • Number that represents the metadata
  • Refer Here for more info on inodes

Linux Disk Mounting and Partition

  • Disk
  • FileSystem
  • Mount

Exercise

  • Find the disks connected to the linux
fdisk -l
  • Attach 1GB disk to the existing ec2 instance and execute the following commands
fdisk -l 
ls -lart /dev
  • Apply the filesystem to the disk (ext4/xfs)
mkfs -t ext4 /dev/xvdf
  • Mounting the disk to some directory
df -h
mkdir /testdir
mount /dev/xvdf /testdir
df -h

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About learningthoughtsadmin