• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/45

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

45 Cards in this Set

  • Front
  • Back
To mount another VG from another system to your new system
echo "0 1 0" /sys/class/scsi_host/host0/scan
vgexport vg_humu
vgimport vg_humu
vgchange -ay vg_humu
mount /dev/vg_humu/LogVol00 /humu
What two tools are used to create and manage partitions?
fdisk
parted
How do you mount all swap files in /etc/fstab?
swapon -a
How do you see all active swap files?
swapon -s
-or-
cat /proc/swaps
Encrypted Filesystem Setup
Build and Format Partitions
fdisk /dev/sdb
cryptsetup luksFormat /dev/sdb1
cryptsetup luksOpen /dev/sdb1 testcrypt
mkfs -t ext4 /dev/mapper/testcrypt

Update the tabs and make the /t
Run blkid and get the UUID of crypted drive and copy
edit /etc/crypttab and add "testcrypt /dev/disk/by-uuid/{paste UUID} /root/testcrypt_passkey" (This will map to dev/mapper for you)
add /dev/mapper/testcrypt /t ext4 defaults 1 0 (to fstab)
mkdir /t

Build the passkey and Add to the crypt
grub-md5-crypt (copy hash)
vi /root/testcrypt_passkey (paste hash)
chmod 600 /root/testcrypt_passkey
cryptsetup luksAddKey /dev/sdb1 /root/testcrypt_passkey

reboot
Leave rd_NO_LUKS in the kernel arguments in grub.conf to not prompt for password
remove rd_NO_LUKS to prompt for password on boot
Build an LV from a newly installed 2 GB disk /dev/sdc
fdisk /dev/sdc (change type to LVM whilst partitioning)
pvcreate /dev/sdc1
vgcreate vg_fish /dev/sdc1
lvcreate -L 1.99GB -n lv_fish vg_fish
mkfs -t ext4 /dev/vg_fish/lv_fish
mkdir /fish && mount /dev/vg_fish/lv_fish /fish
df -h
What are the general steps to creating an LV from a blank disk?
fdisk it to create partition
Create a PV
Create a VG
Create a LV
Create a filesystem
Make directory and mount said filesystem
What are the specific steps to extending an LV to an added disk?
/dev/sdb is the existing disk and /dev/sdc is the new disk
fdisk /dev/sdc (use 8e)
pvcreate /dev/sdc1
vgextend vg_fish /dev/sdc1
lvextend -L+1.99GB -n /dev/vg_fish/lv_fish
e2fsck -f /dev/vg_fish/lv_fish
resize2fs /dev/vg_fish/lv_fish 2500M (this would only add 500 to the FS)
What are the general steps to extending an LV to an added disk?
fdisk the new disk and use (8e)
pvcreate new partition (not the disk)
vgextend
lvextend
e2fsck -f (or just fsck -f)
resize2fs
How do you create a swap volume from new disk /dev/sdc?
fdisk /dev/sdc (use 82)
mkswap /dev/sdc1
edit fstab
swapon -a
cat /proc/swaps (To see active swaps)
What are the two ways to format the filesystem format command?
mkfs -t ext4
mkfs.ext4
How do you convert a filesystem to ext3?
tune2fs -j /dev/sdb1
How do you convert a filesysten to ext4?
Go to ext3 first, and unmount it
tune2fs -O extents,uninit_bg,dir_index /dev/sdb1
How do you see active swap files?
cat /proc/swaps
What is /bin
Essential Command line utilities.
Do Not mount seperately or you can't use a rescue disk
What is /dev
Hardware and Software drivers
Do Not mount seperately
What is /etc
Most basic configuration files
Do Not mount seperately
What is /home
Home directories for all users except root
Can definitely mount seperately
What is /root
Root's home directory
Do Not mount seperately like you can with /home
What is /lib
Program libraries for the kernel and command line utilities
What is /misc and /net
Both automounter only directories
What is /mnt
A legacy mount point for removable media that grandpa used
What is /opt
Common location for third-party application files
What is /proc
Virtual filesystem in RAM with currently running kernel processes
You can't mount seperately
What is /sbin
System administration commands
Do Not mount seperately
What is /tmp
Deleted by Linux periodically
What is /usr
Small programs accessible to all users (sys admin commands and utils)
Which 8 mounts should not ever be mounted seperately?
These should always be part of /
/bin
/dev
/etc
/lib
/proc
/root
/sbin
/selinux
What are the different PV Commands (5)?
pvdisplay (detailed PV list)
pvs or pvscan (simple PV list)

pvcreate
pvresize
pvremove
What are the different VG commands (6)?
vgdisplay (detailed VG list)
vgs or vgscan (simple VG list)

vgcreate
vgextend
vgreduce
vgremove
What are the different LV commands?
lvdisplay (detailed LV list)
lvs or lvscan (simple LV list)

lvcreate
lvextend
lvreduce
lvremove
lvresize
What are the common commands with relation to PV VG and LV?
All




PV and LV only
VG and LV only
display
s or scan
create
remove

resize (only PV and LV)
extend (only VG and LV)
reduce (only VG and LV)
Chart of PV VG and LV commands
PV VG LV
display display display
s or scan s or scan s or scan
create create create
remove remove remove
resize resize
extend extend
reduce reduce
Chart of PV VG and LV commands
display
s or scan
create
remove
resize
extend
reduce
PV VG LV
x x x
x x x
x x x
x x x
x x
x x
x x
How can you format the resize2fs command to not use all the
available space on a newly resized LV?
resize2fs /dev/vg_test/lv_test 1900M
In the fstab file, what are the valid filesystem types?
ext, ext2, ext3, ext4, msdos, vfat, devpts, proc, tmpfs, udf, iso9660, nfs
smb, and swap
In the fstab, what do the two numbers 0 1 or whatever mean?
The first is the dump value. 0 dumps it, 1 saves to disk upon exit of Linux

The second value is the filesystem check order.
root 1
removable 0
All else 2
What mount options are included in defaults in fstab?
rw
suid
dev
exec
auto Looks through /etc/filesystems for appropriate filesystem
nouser Only root can mount the filesystem
async
What are other options for mounting besides defaults in fstab?
atime Updates inode time each time file is accessed
ro
user (allows non root to mount filesystem, but also sets no suid, noexec, no dev)
You cam add a no to most commands included in defaults as well
What are the two main virtual directories?
/proc
/sys
How would you mount to an NFS datastore in fstab?
nasshare1:/vol/ingenix /nas/sftp nfs rw,tcp,rsize=8192,wsize=8192,timeo=14,intr,upd 0 0
How would you set up an SMB share in fstab?
//server/pub /share cifs rw,username=user,password=pass 0 0
How can you setup a samba mount is fstab with a secret password?
With visible password
//server/pub /share cifs rw,username=user,password=pass 0 0

Without visible password
//server/pub /share cifs rw,credentials=/etc/secret 0 0
make a file '/etc/secret and chmod it to 600
username=user
password=password
With automounter, what are the five files?
/etc/auto.master
/etc/auto.misc - Example mounts
/etc/auto.home - for configuring home directories
/etc/auto.net - NFS
/etc/auto.smb - SMB
How do you activate the automounter?
start the autofs service