Linksys AC Series Router Configuration Tips for OpenWRT: Difference between revisions
m →DD  | 
				|||
| Line 2,971: | Line 2,971: | ||
**conv = noerror = Don't stop on read errors, sync = If an error occurs use zeros or nuls to pad file, progress=show the progress  | **conv = noerror = Don't stop on read errors, sync = If an error occurs use zeros or nuls to pad file, progress=show the progress  | ||
=====  | =====Tip for Preparing a Drive or Partition for Cloning to an Image File=====  | ||
Before cloning a partition to an image file, to save space on the image file, "zero out" all unallocated space.  | Before cloning a partition to an image file, to save space on the image file, "zero out" all unallocated space.  | ||
| Line 2,983: | Line 2,982: | ||
*rm ZeroByteFile (this deletes the "Zero Byte File" to free up space as the above DD command made the ZeroByteFile as large as all of the available free space on the drive.)  | *rm ZeroByteFile (this deletes the "Zero Byte File" to free up space as the above DD command made the ZeroByteFile as large as all of the available free space on the drive.)  | ||
The below example(s) copies a single partition (on a drive that contains multiple partitions) in 64K chunks to a compressed (TAR / GZ (GunZip)) file.  | ===== Partition Cloning Example =====  | ||
The below example(s) copies a single partition (on a drive that contains multiple partitions) in 64K chunks to an image in a compressed (TAR / GZ (GunZip)) file.  | |||
*Generic Example: dd if=/dev/sdXy conv=sync,noerror bs=64K status=progress | gzip -c  > /WhatEverPath/WhatEverFile.img.gz (-c=Do not change files)  | *Generic Example: dd if=/dev/sdXy conv=sync,noerror bs=64K status=progress | gzip -c  > /WhatEverPath/WhatEverFile.img.gz (-c=Do not change files)  | ||
**Example: dd if=/dev/sdb1 conv=sync,noerror bs=64K status=progress | gzip -c  > /mnt/sdb2/DD/EXT4a-9.20.2020.img.gz (this file is named after the partition it exists on and the date, but can be named anything)  | **Example: dd if=/dev/sdb1 conv=sync,noerror bs=64K status=progress | gzip -c  > /mnt/sdb2/DD/EXT4a-9.20.2020.img.gz (this file is named after the partition it exists on and the date, but can be named anything)  | ||
Remember, the TAR/GZ file will contain a single image file, which in turn contains all of the individual files and directories from the source partition or drive (similar to an ISO File or files created by other cloning software).  | |||
* tune2fs -U random /dev/sdXy*  | ===== Tip for Configuring a Cloned Drive after Cloning =====  | ||
WARNING: When cloning an entire drive, ''everything'' will be cloned, including the [[wikipedia:Universally_unique_identifier|UUID]] of the partition.  One of the "U"s in UUID stands for "unique".  After a drive is cloned, the UUID isn't "unique" anymore.   Two drives will have the same UUID.  If the second flash drive is being used for the sole purpose of backing up settings with the intent of disconnecting the drive and putting it aside, the UUID can be left as it is.  If the second drive is left connected the UUID should be changed to to prevent confusion with the source drive.  The below command will change the UUID to a random ID (see above section for installing the tune2fs utility)  | |||
*tune2fs -U random /dev/sdXy*  | |||
This command will change the UUID to the one specified;  | This command will change the UUID to the one specified;  | ||
| Line 3,002: | Line 3,005: | ||
In the above examples X and y should be replaced with actual mount point references.  IE, sda1, sdb3, sde2, etc.  | In the above examples X and y should be replaced with actual mount point references.  IE, sda1, sdb3, sde2, etc.  | ||
===== Accessing an Image File (IE, mount it like a drive) =====  | =====Accessing an Image File (IE, mount it like a drive)=====  | ||
In the above example where a partition was cloned to an image file, utilities like WinRAR, WinImage, etc. cannot be used to access the file.  Since the image file represents an entire drive or partition, it can be mounted just like a physical drive.  | |||
To mount a partition (not a drive);  | To mount a partition (not a drive);  | ||
*mkdir /tmp/MyMountPoint (  | *mkdir /tmp/MyMountPoint (the directory can be any directory or file name, an advantage to using the /tmp directory is one doesn't have to worry about dismounting the image as it will not be mounted after a router reboot because the mount point is in the /tmp directory, the image file will exist of course, assuming it is not also in the /tmp directory)  | ||
*mount -o loop -t   | *mount -o loop -t WhatEverFileSystem /WhatEverPath/WhatEverImage.img /tmp/MyMountPoint  | ||
**-t = the type of file system (this could be -t vfat, -t ntfs, -t ext2, etc.,   | **-t = the type of file system (this could be -t vfat, -t ntfs, -t ext2, -t ext4 etc., and it should obviously match the type of the original file system, no experiments were done to see if mount utility could "auto detect" the file system, but it may have the capability)  | ||
**-o = Option (let the mount command know it is a "loop" device)  | **-o = Option (let the mount command know it is a "loop" device)  | ||
The mounted image file will be accessible at the   | |||
====Good 'ole Fashion, just make a copy====  | ====Good 'ole Fashion, just make a copy====  | ||
Forget all the fancy backup stuff for this one.  Sometimes it's good just to make a manual copy of things.  Not so much   | Forget all the fancy backup stuff for this one.  Sometimes it's good just to make a manual copy of things.  This method works great for configuration files.  Not so much to avoid a failed drive, but more to preserve a working copy of a known good configuration file.  The idea is whenever one embarks on an upgrade or a major change (even a minor one too) to a service, sometimes it's good to make a copy of a working configuration file.  For instance, using the /etc/config/network configuration file: cp /etc/config/network /etc/config/network-09.30.2020  There, a copy of the original file with a date on the end of it.  Simple and effective if one needs to take a "single step back", instead of walking through the complexity of restoring files from Restic or a DD Tar.GZ file.  | ||
==Border Mail System (Postfix, MailScanner, MailWatch, ClamD,==  | ==Border Mail System (Postfix, MailScanner, MailWatch, ClamD,==  | ||
===Postfix===  | === Postfix ===  | ||
====Files & Permissions====  | ====Files & Permissions====  | ||