0% found this document useful (0 votes)
4 views3 pages

Linux Disk Management Commands Guide

Uploaded by

shyamkma8362
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views3 pages

Linux Disk Management Commands Guide

Uploaded by

shyamkma8362
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

1 yum repolist

2 cat /etc/[Link].d/[Link]
3 exit
4 fdisk -l
5 fdisk -l /dev/sdd
6 fdisk /dev/sdd
7 fdisk /dev/sdc
8 pvcreate /dev/sdc1 /dev/sdd1
9 pvs
10 df -h
11 vgcreate sas_vg /dev/sdc1 /dev/sdd1
12 lvcreate -L 70g -n sasvol01 sas_vg
13 lvcreate -L 25g -n sashybridg sas_vg
14 lvcreate -L 35g -n saswork sas_vg
15 [Link] /dev/sas_vg/sasvol01
16 [Link] /dev/sas_vg/sashybridg
17 [Link] /dev/sas_vg/saswork
18 mkdir /saswork
19 mkdir /sasvol01
20 mkdir /sashybridg
21 vi /etc/fstab
22 mount -a
23 df -h
24 chown sascfg:sasfraud /sasvol01
25 chown sascfg:sasfraud /sashybridg/
26 chown sascfg:sasfraud /saswork
27 chmod 775 /sasvol01
28 chmod 775 /sashybridg/
29 chmod 1777 /saswork
30 su - sascfg
31 mkdir /sasshare
32 mkdir /sasdepot
33 mkdir /sasscoutf
34 vi /etc/fstab
35 mount -a
36 df -h
37 cat /etc/fstab
38 df -h
39 chown sascfg:sascfg /sasshare
40 chown sascfg:sasfraud /sasshare
41 chown sascfg:sasfraud /sasdepot
42 chown sascfg:sasfraud /sasscoutf
43 cd /sasscoutf
44 ls
45 cd
46 cd /sasshare
47 ls
48 cd
49 cd /sasshare
50 ls -alh
51 cd
52 df -h
53 yum list all | grep -i falcon
54 exit
55 vgs
56 lvcreate -L 100g -n oracle sas_vg
57 [Link] /dev/sas_vg/oracle
58 mkdir /oracle
59 vi /etc/fstab
60 mount -a
61 groupadd -g 1200 oinstall
62 useradd -d /oracle -m -u 1200 -s /bin/bash -g oinstall oracle
63 passwd oracle
64 chown oracle:oinstall /oracle
65 df -h
66 ls -ld /oracle
67 telnet [Link] 80
68 ifconfig -a
69 yum clean all
70 kill -9 15559
71 yum clean all
72 yum repolist
73 df -h
74 cd /etc/[Link].d/
75 ll
76 cat [Link]
77 yum clean all
78 yum repolist
79 su - oracle
80 su - sascfg
81 su - oracle
82 exit
83 su - oracle
84 pwd
85 su - oracle
86 su - sascfg
87 exit
88 su - oracle
89 yum clean all
90 yum repolist
91 exit
92 su -
93 exit
94 yum clean all
95 yum repolist
96 yum clean all
97 yum repolist
98 exit
99 yum clean all
100 yum repolist
101 systemctl status auditd
102 systemctl reload auditd
103 service auditd reload
104 service auditd restart
105 journalctl -xe
106 cd /etc/audit/
107 ls -alh
108 rm -rf [Link]
109 mv [Link].8888.2022-08-21@23:40:54~ [Link]
110 service auditd reload
111 service auditd restart
112 service auditd start
113 service auditd status
114 systemctl status auditd
115 reboot
116 cat /etc/system-release
117 yum update -y
118 init 6
119 uname -a
120 cat /etc/system-release
121 cat /etc/sudoers
122 sestaus
123 sestatus
124 cat /etc/audit/[Link]
125 vi /etc/ssh/sshd_config
126 vi /etc/ssh/ssh_config
127 systemctl restart sshd
128 systemctl reload sshd
129 systemctl restart sshd
130 sestatus
131 init 6
132 uname -a
133 cat /etc/system-release
134 sestatus
135 df -h
136 exit
137 cat /etc/ssh/sshd_config
138 cat /etc/passwd
139 su - sasmehose
140 exit
141 su - sascfg
142 su - sasmehose
143 cd /
144 ll
145 cd sashybridg
146 ls -al
147 cd ..
148 mv sashybridg sashybridq
149 df -h
150 cat /etc/fstab
151 umount /sashybridg
152 df -h
153 mv sashybridg sashybridq
154 vi /etc/fstab
155 mount /sashybridq/
156 df -h
157 history
158 vi .bash_profile
159 vi .bash_history
160 cat .bash_history
161 history > /tmp/[Link]

Common questions

Powered by AI

'systemctl restart sshd' restarts the SSH daemon, which could momentarily disrupt any current SSH connections to the server. Upon restarting, the service reloads its configuration files and applies changes made to them. This action is crucial after modifying configuration files like '/etc/ssh/sshd_config', as it ensures the daemon functions with updated settings. Care should be taken to notify users, as this command temporarily cuts off remote session access, potentially disrupting administrative tasks .

Setting a directory permission to '1777' assigns the 'sticky bit', which allows users to create files within the directory but only delete or modify their own files, not those of others. This setting is essential in shared environments like '/tmp', where multiple users need to write data. However, while it maintains some level of user isolation, it does not prevent exploitation through users writing malicious files. Careful monitoring and additional access controls are advised to mitigate potential security risks, ensuring that even with '1777', sensitive directories are not exposed to unnecessary vulnerabilities .

The 'mkfs.xfs' command is used to format a logical volume with the XFS filesystem, which is a high-performance journaling filesystem. After creating logical volumes with 'lvcreate', it is necessary to format them before they can be used to store data. Formatting with 'mkfs.xfs' initializes the volume with the appropriate filesystem structures, preparing it for mounting and data storage .

Executing 'yum update -y' is critical for maintaining system stability and security as it automatically installs available updates for all installed packages without requiring additional user confirmation. This practice ensures that the system benefits from the latest security patches, bug fixes, and feature enhancements. However, it can also introduce unforeseen changes that might affect compatibility with existing configurations or applications, highlighting the importance of reviewing updates before installation on mission-critical systems .

After creating directories under the root directory, the 'chown' and 'chmod' commands are essential for setting appropriate permissions and ownerships. 'chown' changes ownership to a specified user and group, here typically set as 'sascfg:sasfraud', which dictates who can access the directories and perform operations within them. 'chmod' sets the file permissions for users, groups, and others; for instance, a permission like 775 grants read, write, and execute permissions to the owner and the group, and read and execute to others. This command sequence ensures secure and appropriate access control tailored to different users and applications .

'systemctl reload auditd' reloads the audit daemon's configuration without stopping the service, allowing it to continue normal logging activities. In contrast, 'service auditd restart' stops and then restarts the audit service. This restart temporarily halts logging, which can result in missing logs for the period it is down, potentially impacting audit trails. While 'reload' is less disruptive and preferred for configuration updates, 'restart' might be necessary for critical changes requiring a fresh start of the daemon .

'pvcreate /dev/sdc1 /dev/sdd1' initializes the specified partitions as physical volumes, laying the groundwork for their integration into a volume group. This command is part of logical volume management, which facilitates flexible storage allocation. Once physical volumes are set up, they can be added to a volume group via 'vgcreate', allowing logical volumes to be created and managed with the added flexibility of resizing and spanning multiple disks, optimizing storage use and management .

Modifying '/etc/fstab' involves editing this file to update or add entries for new or modified filesystems that should be automatically mounted at boot time. Each entry specifies the device, mount point, filesystem type, and mount options. After editing, executing 'mount -a' will attempt to mount all filesystems specified in '/etc/fstab'. This step is essential when changes such as renaming directories (e.g., from 'sashybridg' to 'sashybridq') occur, ensuring the system mounts these filesystems correctly upon the next boot. This setup automates and maintains consistency in the mounting operations .

The sequence of commands for extending a volume group involves first identifying and preparing physical devices. 'pvcreate' is used to initialize a physical device as a physical volume for use by the LVM (Logical Volume Manager). 'vgcreate' then creates a volume group, which is a pool of storage from the physical volumes, allowing for more flexible partitioning and resource allocation. Lastly, 'lvcreate' creates logical volumes from the volume group, which can be used as traditional storage partitions. Each step in the sequence builds upon the last, translating raw storage into structured, manageable storage units .

The 'yum' package manager facilitates repository management by maintaining information about available software packages. The 'yum clean all' command removes cached data, which might include outdated metadata or packages, thereby freeing up space and resolving potential conflicts. 'yum repolist' updates and displays a list of available repositories and their status, ensuring that the system has access to the latest information about package updates and installations. Together, these commands help maintain a clean and current package management environment .

You might also like