Spring 2017 CSCI 373 Homework 7

This assignment is due by 5:00 PM Tuesday, 28 March.

A file system exercise

Make sure your Pi doesn’t have any logical volumes. Run pvscan, vgscan and lvscan to find logical volume structures. Use lvremove, vgremove and pvremove to delete them.

Keep the partitions for / (/dev/mmcblk0p2) and /boot (/dev/mmcblk0p1); but delete all others. Create a 5 Gbyte partition /dev/mmcblk0p3 and create a final partition /dev/mmcblk0p4 that fills the remainder of the SD card.

Your partition table should look something like the following. That may be small differences due to the size of your SD card. The important thing is to have no overlapping partitions. After you have carefully checked your partititions, reboot.

Device         Boot    Start      End  Sectors  Size Id Type
/dev/mmcblk0p1          8192   131071   122880   60M  c W95 FAT32 (LBA)
/dev/mmcblk0p2        131072 16908287 16777216    8G 83 Linux
/dev/mmcblk0p3      16908288 27394047 10485760    5G 83 Linux
/dev/mmcblk0p4      27394048 31422463  4028416  1.9G 83 Linux

Now format /dev/mmcblk0p4 to be an ext4 file system.

Within the /dev/mmcblk0p3 partition create a volume group csci373VG with three logical volumes: msdos373LV with 32 MB, ext373LV with 2 GB, and xfs373LV with 2 GB. The ubutu LVM wiki will show you how to do this.

Run pvdisplay, vgdisplay and lvdisplay to verify that you have performed this correctly. Check out the following capture of the output of lvdisplay to see if you got it right.

Create mount points for your four file systems and modify /etc/fstab so these are mounted at boot time. ake sure that df produces roughly the following output. (The file usage may be different.) This example shows you how your should name your mount point directories.

Filesystem                       1K-blocks    Used Available Use% Mounted on
/dev/mmcblk0p4                     1949776  618096   1214588  34% /mnt/yourid
/dev/mapper/csci373VG-msdos373LV     32686       2     32684   1% /mnt/msdos
/dev/mapper/csci373VG-ext373LV     1998672  100208   1777224   6% /mnt/ext
/dev/mapper/csci373VG-xfs373LV     2086912  282424   1804488  14% /mnt/xfs

Copying your home

First, copy all the non-dot files and directories of your home directory on the CSCI Linux computers to /mnt/yourid on your Pi. (If you run out of space, just delete enough files to get /mnt/yourid to less the 512 Mbytes of storage.) Then, copy all the files and directories of your home directory on Pi to /mnt/yourid on your Pi. This will replace many files.

Moving to a new home

You’ll need to log in using the csci373 account to do this step.

Change /etc/fstab to mount the /dev/mmcblk0p4 as your Pi home directory. You’ll need to umount and remount /dev/mmcblk0p4 to get this to work.

Backing up your home directory

Use dump and Use gzip to make a backup of your home directory. Leave the backup in the /var/tmp directory.

Turn in

You don’t need to turn anything in. I will login to your personal Pi and check it out. However, there is a Homework 7 moodle page for grades and comments.