cancel
Showing results for 
Search instead for 
Did you mean: 
Igris
Mission Specialist
Mission Specialist
  • 11.9K Views

How do you remember commands ?

Jump to solution

So while preparing for RHCSA configuring stratis you need the following in /etc/fsbab

x-systemd.requires=stratisd.service
 
yet if you do a man on stratisd you wont get that option. On the exam you dont have internet accees so if you forget it how would you proceed ? 
 
Just forfeit the task and get 0 points for it ? 
Labels (1)
2 Solutions

Accepted Solutions
Yeni84
Flight Engineer
Flight Engineer
  • 8,914 Views

This is how I do it. In general for each command, options or task, I try to find the related manual pages for guidance or HINTS. You may remember the command name but not ALL the options or the syntax order.

For this case you mention, I think like this:

1) The Stratis file system cannot be mounted unless the stratisd daemon is active. So it REQUIRES to set A condition in the fstab for the FS to be mounted only when stratisd is active. What is the syntax of this condition? Then I think at step 2.

2) stratis is managed by systemd daemon (like all services). So it is something related to systemd. And fstab is about mounting. So the man page for this should be related to systemd and mounting. This is # man 5 systemd.mount (attention there is also # man 1 systemd-mount). To receive a hint about the man page name, you can man -k mount . 

3) I open the man 5 systemd.mount and press / for search, type "requires" (from step 1), Enter. I find "x-systemd.requires". Then I ask myself what it requires? We mentioned this at step 1, the stratisd service.

4) If I cannot remember "stratisd.service", I run the command bellow (the string appears two times). This command we still need to run before # stratis create ... as a prerequisite. I have to check if stratisd is active and enabled at boot. Like before you operate on network connections, you need to check if NetworkManager is active.

[root@server-base ~]# systemctl status stratisd
● stratisd.service - Stratis daemon
Loaded: loaded (/usr/lib/systemd/system/stratisd.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2020-12-17 17:44:53 EET; 3s ago
Docs: man:stratisd(8)
Main PID: 953 (stratisd)
Tasks: 1 (limit: 5074)
Memory: 5.6M
CGroup: /system.slice/stratisd.service
└─953 /usr/libexec/stratisd --debug

5) At the end it results: x-systemd.requires=stratisd.service .

I hope it helps.

 

View solution in original post

Tracy_Baker
Starfighter Starfighter
Starfighter
  • 8,453 Views

As someone else stated, which I think needs reiterating, practice!

Yes, the man pages work and all that; however, in the testing environment you'll only want to spend time in the man pages only when you need to. The less time, the better.

It is a timed test. You will do well to commit as much to memory as you can. The best way to commit it to memory is to practice. Do the task, do it again, and then do it 10 more times.

Pretty soon using x-systemd.requires=stratisd.service in /etc/fstab when configuring Stratis will be second nature.

Don't forget, VDO is also part of the RH134 material and also needs it own entry in /etc/fstab: x-systemd.requires=vdo.service

To answer your general question, "How do you remember commands?" I use mnemonics every chance I get. I think most people do without thinking a whole lot about it - and most commands make sense "out of the box". For example:

cd = change directory
pwd = present working directory
ls = list (directory content)
semanage fcontext = manage SELinux, file context (type)
nmcli = network manager, command line interface
chage = change password aging
setfacl = set file access control list
crontab = chronological (time) tables

Incidentally, tab generally means "tables," like the crontab example. /etc/fstab is file system tables. If you think about it, they are tables as they have rows and columns. There are others, but one would need to check if they're on the published objectives for the exam.

Then there are the "gets" and "sets" - as I call them. get* gets configuration information about something and set* sets (creates / changes) a configuration. some are:

getfacl / setfacl = file access control list
getenforce / setenforce = SELinux enforcement level (runtime)
getsebool / setsebool = SELinux Booleans

Finally, don't forget about TAB completion. It will complete many commands, subcommands, options (especially those beginning with --), and arguments. TAB TAB can be used, sometimes, to have it return a list of available items - and can even be contextual (try using TAB TAB to build an nmcli command).

Program Lead at Arizona's first Red Hat Academy, est. 2005
Estrella Mountain Community College

View solution in original post

19 Replies
Yeni84
Flight Engineer
Flight Engineer
  • 8,915 Views

This is how I do it. In general for each command, options or task, I try to find the related manual pages for guidance or HINTS. You may remember the command name but not ALL the options or the syntax order.

For this case you mention, I think like this:

1) The Stratis file system cannot be mounted unless the stratisd daemon is active. So it REQUIRES to set A condition in the fstab for the FS to be mounted only when stratisd is active. What is the syntax of this condition? Then I think at step 2.

2) stratis is managed by systemd daemon (like all services). So it is something related to systemd. And fstab is about mounting. So the man page for this should be related to systemd and mounting. This is # man 5 systemd.mount (attention there is also # man 1 systemd-mount). To receive a hint about the man page name, you can man -k mount . 

3) I open the man 5 systemd.mount and press / for search, type "requires" (from step 1), Enter. I find "x-systemd.requires". Then I ask myself what it requires? We mentioned this at step 1, the stratisd service.

4) If I cannot remember "stratisd.service", I run the command bellow (the string appears two times). This command we still need to run before # stratis create ... as a prerequisite. I have to check if stratisd is active and enabled at boot. Like before you operate on network connections, you need to check if NetworkManager is active.

[root@server-base ~]# systemctl status stratisd
● stratisd.service - Stratis daemon
Loaded: loaded (/usr/lib/systemd/system/stratisd.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2020-12-17 17:44:53 EET; 3s ago
Docs: man:stratisd(8)
Main PID: 953 (stratisd)
Tasks: 1 (limit: 5074)
Memory: 5.6M
CGroup: /system.slice/stratisd.service
└─953 /usr/libexec/stratisd --debug

5) At the end it results: x-systemd.requires=stratisd.service .

I hope it helps.

 

  • 1,488 Views

Perfectly explained - this is very helpful.

0 Kudos
Amel
Mission Specialist
Mission Specialist
  • 8,890 Views

Logical

 

charith1994
Flight Engineer Flight Engineer
Flight Engineer
  • 8,884 Views

Well  it's all about continuous practice my friend.Some time you can use configurations file and man pages to help remember the commands.but sometimes it depends on ur practice and memory.

  • 8,858 Views

regarding this perticular mount option, you can check out the man page for "systemd.mount"

It has a "fstab" subsection that mentions "x-systemd.requires=" key which could be a way to remember the option and not make any typo and the value "stratisd.service" is self explanaitory.

only reboot can confirm if what you mentioned was correct or not.

alfie
Cadet
Cadet
  • 8,463 Views

You don't need to remember it at all.

I assume you need to attend the RHCSA/RHCE, under this condition.

First of all, you will need to configure the yum repo which will help to install software without thinking about dependence issue with yum/dnf-3.

Then you can install man (No doubt about that), then you could use `man` command thankfully.  The `x-systemd.requires=` is mark in `man systemd.mount`, just glance it and write it down, done.  (Be careful the name systemd.mount NOT systemd-mount).

Tracy_Baker
Starfighter Starfighter
Starfighter
  • 8,454 Views

As someone else stated, which I think needs reiterating, practice!

Yes, the man pages work and all that; however, in the testing environment you'll only want to spend time in the man pages only when you need to. The less time, the better.

It is a timed test. You will do well to commit as much to memory as you can. The best way to commit it to memory is to practice. Do the task, do it again, and then do it 10 more times.

Pretty soon using x-systemd.requires=stratisd.service in /etc/fstab when configuring Stratis will be second nature.

Don't forget, VDO is also part of the RH134 material and also needs it own entry in /etc/fstab: x-systemd.requires=vdo.service

To answer your general question, "How do you remember commands?" I use mnemonics every chance I get. I think most people do without thinking a whole lot about it - and most commands make sense "out of the box". For example:

cd = change directory
pwd = present working directory
ls = list (directory content)
semanage fcontext = manage SELinux, file context (type)
nmcli = network manager, command line interface
chage = change password aging
setfacl = set file access control list
crontab = chronological (time) tables

Incidentally, tab generally means "tables," like the crontab example. /etc/fstab is file system tables. If you think about it, they are tables as they have rows and columns. There are others, but one would need to check if they're on the published objectives for the exam.

Then there are the "gets" and "sets" - as I call them. get* gets configuration information about something and set* sets (creates / changes) a configuration. some are:

getfacl / setfacl = file access control list
getenforce / setenforce = SELinux enforcement level (runtime)
getsebool / setsebool = SELinux Booleans

Finally, don't forget about TAB completion. It will complete many commands, subcommands, options (especially those beginning with --), and arguments. TAB TAB can be used, sometimes, to have it return a list of available items - and can even be contextual (try using TAB TAB to build an nmcli command).

Program Lead at Arizona's first Red Hat Academy, est. 2005
Estrella Mountain Community College
aanis
Cadet
Cadet
  • 6,279 Views

Sorry to resurrect this thread after a long time, but man, I just wasted maybe 4 hours trying to troubleshoot this stratis issue while I was studying for RHCSA from the Pearson course (sander van vugt) because they never mentioned this mount option at all. My god, I was going crazy. It now makes me wonder if I should actually invest in the official Red Hat Training material (Subscription) if it is that much better and will save me time to learn.

0 Kudos
Monty
Flight Engineer Flight Engineer
Flight Engineer
  • 6,142 Views

They left it out of the printed/ebook, but the author mentioned he forgot it in the video training for the RH134 online training. You'd think they could go and update the eBook though...

0 Kudos
Join the discussion
You must log in to join this conversation.