TriBit

Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by TriBit

  1. So it seems the XFS filesystem stores the UUID in the superblock. Since unraid’s new disk rebuild is the same as the old, I guess it will show the same UUID. If this is correct apparently you can generate a new UUID with: xfs_admin -U generate /dev/sdx1 were x is the drive’s designated letter. otherwise the system will not let me mount the drive.
  2. Problem: I've just recently swaped out an 8yr old drive with a new one. During the rebuild the old drive was listed under unassigned devices, so I attempted to mount the old drive to check the files. The old drive would not mount under unassigned devices due to the error below. It looks like linux attached/kept the old drive UUID to the new drive in my disk array while the unassigned devices also did the same. I only say that by looking at the serial number UUID list it seems linux or unraid for that matter has kept the old UUID to the new drive serial number. Given the permutations possible for UUID allocation this cant be a random match if unraid reassigned a new UUID to be the same. ************************** SYSLOG ERROR LINE: Dec 3 12:11:36 Planck unassigned.devices: Mount drive command: /sbin/mount -t xfs -o rw,noatime,nodiratime '/dev/sdl1' '/mnt/disks/WDC_WD1001FALS-00J7B0_WD-WMATV6728186' Dec 3 12:11:36 Planck kernel: XFS (sdl1): Filesystem has duplicate UUID c3b9058b-ee4f-4f23-a056-8a03c96b1038 - can't mount Dec 3 12:11:36 Planck unassigned.devices: Mount of '/dev/sdl1' failed. Error message: mount: /mnt/disks/WDC_WD1001FALS-00J7B0_WD-WMATV6728186: wrong fs type, bad option, bad superblock on /dev/sdl1, missing codepage or helper program, or other error. Dec 3 12:11:36 Planck unassigned.devices: Partition 'WDC_WD1001FALS-00J7B0_WD-WMATV6728186' could not be mounted... *************************** Looking at the Serial and UUID's as listed with terminal command "lsblk -o SERIAL,UUID" WD-WXC1A29EH7D2 c3b9058b-ee4f-4f23-a056-8a03c96b1038 (New drive added to array) WD-WMATV6728186 c3b9058b-ee4f-4f23-a056-8a03c96b1038 (Old drive moved to unassigned devices) Terminal command blkid shows linux kept the device mount point at sdd with the orignal UUID (didnt create new one and i guess why should it?) /dev/sdd1: UUID="c3b9058b-ee4f-4f23-a056-8a03c96b1038" TYPE="xfs -----------This is the new drive serial WD-WXC1A29EH7D2 in the array and linux maintained the old UUID /dev/sdl1: UUID="c3b9058b-ee4f-4f23-a056-8a03c96b1038" TYPE="xfs" -------------This is the old drive serial WD-WMATV6728186 moved to unassigned devices but UUID is same. You would think at that the serial number should follow the same UUID and allocate a new UUID to new drives when added. Is this a potential bug with unassigned devices or unraid code? Thanks.
  3. Although may not be considered a concern, the unassigned devices plugin provides the ability to add a custom script using Linux bash command. The code you provided was not clear how it functioned or how to use those variables as it's defined within your plugin code. So beyond that, no big deal, I started to to test some scripts myself. I came across some odd behavior. For example the following code should mount and un-mount a drive in linux using UUID. In linux command line: mount UUID= "$UID" "$MPOINT" ---where UID is the UID of your target device (as shown with blkid) and MPOINT is the path you want to mount. to un-mount just: umount $MOUNTPOINT These 2 functions return an error when the external device was plugged in (Note: without auto mount enabled or a script provided in unassigned devices). Techincally I'm aware I don't have to use mount command with the Auto mount feature and likely not the UUID as the script is unique to the device. The only way to get these 2 functions to work correctly is to mount and un-mount the device within your unassigned devices plugin GUI button. After that they work fine and you can even see the mount/umount icon change within the plugin. Its almost like when the external device is plugged in, the unassigned devices plugin did not interface/communicate with linux kernal properly at first. This left me troubleshooting code that should work. The code line "/usr/local/sbin/rc.unassigned umount $DEVICE" if you had not provided this great script I would have never known this. My code would have been just umount $MOUNTPOINT. I haven't tested this as a replacement, but I expect it would fail to un-mount the drive. So I guess what is the issue with the failed commands? I assume the unassigned devices script will execute when the plugin sees a drive attached regardless if its set to auto mount? I've been using the Pro product since 2008 (Very Unique). Leaps and bounds amazing as of today. I thank all the community developers and Limetech for developing such an amazing platform. Thanks for all your hard work!
  4. Ok thx dlandon, so the unassigned devices plugin itself has the “owner” variable defined in its script. I have to get used to the fact Linux (And have learnt this the hard way) is just the base platform and unraid and it’s plugins function on top of that as a separate program calling and interfacing with the overall Linux kernel. If the unassigned devices code is open source, then I would be able to see how it functions. Else it can be challenging to write custom scripts thinking from pure bash Linux interface which it’s not in this case.
  5. Good Day, missing something and could be a dumb question, but.... dlandon created a great script at the beginning of this thread to copy files from unraid to external drive or external drive to unraid. Unfortunately in the portion of the script that uses the $OWNER variable, I don't understand how it works. Its not a command in the linux bash environment and somehow it tests to true when my drive is mounted. I was under the understanding if I was to unmount or mount the drive myself in the unassigned devices GUI the script is not supposed to execute per dlandon's comment "If you mount and unmount the drive from the Unassigned Devices gui, the drive will mount and unmount but the script will not run because it has detected the 'OWNER' as 'user' and will skip the backup." In the script variable "OWNER" is defined in the script to function as -----> : "udev" if executed by UDEV, otherwise "user" In the script the line comes up to test if the unassigned GUI mount/unmount button is pressed by the user or system if [ $OWNER = "udev" ] then logger command here and We start the Rsync command here As $OWNER is a variable (cant find anything in bash environment for OWNER), how is it defined to get the information to test? It seems to test true as the script starts the Rsync command ( condition test ----> [ $OWNER = "udev" ] ) must return 0 to be true, so how it works I'm not sure. Also the script does run if I press the mount/unmount in the GUI post script copy completion, which is not supposed to happen, so I must be missing a definition for OWNER variable. My script: ************************************ #!/bin/bash PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin ## Available variables: # AVAIL : available space # USED : used space # SIZE : partition size # SERIAL : disk serial number # ACTION : if mounting, ADD; if unmounting, UNMOUNT; if unmounted, REMOVE; if error, ERROR_MOUNT, ERROR_UNMOUNT # FSTYPE : partition filesystem # LABEL : partition label # DEVICE : partition device, e.g /dev/sda1 # OWNER : "udev" if executed by UDEV, otherwise "user" # LOGFILE : log file for this script MOUNTPOINT=/mnt/disks/PRORAID-BACKUP/Backup/Array PROG_NAME="Pro-Raid Backup" case $ACTION in 'ADD' ) # # Notify that the device is plugged in. # echo "External Drive Plugged in: `date`" > $LOGFILE /usr/local/emhttp/webGui/scripts/notify -e "Unraid Server Notice" -s "Server Backup" -d "Pro-Raid Backup Mounted" -i "normal" sleep 2 if [ -d $MOUNTPOINT ] then if [ $OWNER = "udev" ] then logger -t "$PROG_NAME" Started echo "Pro-Raid Backup Started: `date`" > $LOGFILE rsync -av --dry run --stats --delete /mnt/user $MOUNTPOINT/ 2>&1 >> $LOGFILE logger -t "$PROG_NAME" Syncing sync -f $MOUNTPOINT logger -t "$PROG_NAME" Unmounting /usr/local/sbin/rc.unassigned umount $DEVICE echo "Pro-Raid Backup Completed: `date`" >> $LOGFILE logger -t "$PROG_NAME" Drive Can Be Removed /usr/local/emhttp/webGui/scripts/notify -e "Unraid Server Notice" -s "Server Backup" -d "Pro-Raid Backup Completed" -i "normal" fi else logger -t "$PROG_NAME" Not Mounted fi ;; 'REMOVE' ) # # Indicate that the device is unmounted. # /usr/local/emhttp/webGui/scripts/notify -e "Unraid Server Notice" -s "Server Backup" -d "Pro-Raid Backup Drive Unmounted" -i "normal" ;; 'ERROR_MOUNT' ) /usr/local/emhttp/webGui/scripts/notify -e "Unraid Server Notice" -s "Server Backup" -d "Could not mount ProRaid Backup" -i "normal" ;; 'ERROR_UNMOUNT' ) /usr/local/emhttp/webGui/scripts/notify -e "Unraid Server Notice" -s "Server Backup" -d "Could not unmount Pro-Raid Backup" -i "normal" ;; esac ********************************* Thanks.