Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.

Unlimited Access

Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.

Exam EX200 topic 1 question 7 discussion

Actual exam question from RedHat's EX200
Question #: 7
Topic #: 1
[All EX200 Questions]

SIMULATION -
Create a 2G swap partition which take effect automatically at boot-start, and it should not affect the original swap partition.

Show Suggested Answer Hide Answer
Suggested Answer: See explanation below.
# fdisk /dev/sda
p
(check Partition table)
n
(create new partition: press e to create extended partition, press p to create the main partition, and the extended partition is further divided into logical partitions)

Enter -
+2G
t
l

W -
partx -a /dev/sda
partprobe
mkswap /dev/sda8

Copy UUID -
swapon -a
vim /etc/fstab
UUID=XXXXX swap swap defaults 0 0
(swapon -s)

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
cloudyhr
Highly Voted 2 years, 3 months ago
create a partition for given size(2G) #fdisk /dev/sdb #n #+2G #w #partprobe check the present free memory #free -h #mkswap /dev/sdb5 #swapon /dev/sdb5 check the swap space and compai with privious value #free -h exit /etc/fstab and add below line /dev/sdb5 swap swap defaults 0 0 wright and exit /etc fstab # swapon -a
upvoted 6 times
...
tylerw6
Most Recent 1 day, 11 hours ago
man fstab says that the second field should be none, not swap. UUID=234wfd none swap defaults 0 0
upvoted 2 times
...
ertgrty
8 months, 1 week ago
first check available swap #free -m second partions available #lsblk #parted -s /dev/vdb mklabel msdos #parted -s /dev/vdb mkpart primary 2048S 2200MB #mkswap /dev/vdb1 #vim /etc/fstab /dev/vdb1 swap swap defaults 0 0 #swapon -a
upvoted 1 times
...
Rahul95
11 months ago
lsblk #to check partition fdisk /dev/sdb #to sda or sdb depending on the disk n # for new p #primary 1 #default partition number enter #first sector +2G #last sector t #to change type and select 82 for swap 82 #code for hex w #save changes partprobe #to update partition table lsblk #to confirm mkswap /dev/sbd1 #to generate UUID, we need UUID to make it permanent lsblk -f #to see file system, should be swap vi /etc/fstab #to make it permanent UUID=xxxxxxxxxxxx swap swap defaults 0 0 free -h swapon -a free -h #swap value must be increased by 2G
upvoted 4 times
...
ktd971
1 year, 2 months ago
#lsblk #free -h #mkswap /dev/sdb #swapon /dev/sdb #free -h #vim /etc/fstab #/dev/sdb swap defaults 0 0
upvoted 1 times
ktd971
1 year, 2 months ago
if sdb it's more than 2G you have to use fstab
upvoted 1 times
...
...
Brabus
1 year, 4 months ago
if it is a swap partition the appropriate partition type (Linux swap) must be set -> t (use l to get a list of known partition types) -> 82
upvoted 1 times
...
Stunomatic
1 year, 5 months ago
echo $(blkid /dev/sdb5) >> /etc/fstab use this command to copy uid to fstab.
upvoted 1 times
memonic
1 year, 3 months ago
blkid is a good comand to know partition UUID but with your command literally the swap partition dont start at boot time
upvoted 1 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...