Routing

 View Only
last person joined: yesterday 

Ask questions and share experiences about ACX Series, CTP Series, MX Series, PTX Series, SSR Series, JRR Series, and all things routing, including portfolios and protocols.
  • 1.  MX80 - Format nand1

    Posted 05-24-2022 05:56
    One of our MX80 routers appears to have a bad sector in nand1 (da1). Over the past 3 months it has locked up twice after displaying this message on the console.
    g_vfs_done():da1s1a[WRITE(offset=8192, length=2048)]error = 5​


    The nand1 device (da1) is recognized at boot and the da1s1a partition completes fsck normally.

    root@edge1% dmesg|grep da1
    da1 at umass-sim1 bus 1 target 0 lun 0
    da1: <ATP ATP IG eUSB 1100> Fixed Direct Access SCSI-4 device
    da1: 40.000MB/s transfers
    da1: 3838MB (7860224 512 byte sectors: 255H 63S/T 489C)
    
    root@edge1% fsck /dev/da1s1a
    ** /dev/da1s1a
    ** Last Mounted on /mnt
    ** Phase 1 - Check Blocks and Sizes
    ** Phase 2 - Check Pathnames
    ** Phase 3 - Check Connectivity
    ** Phase 4 - Check Reference Counts
    ** Phase 5 - Check Cyl groups
    1051 files, 15444 used, 437748 free (44 frags, 54713 blocks, 0.0% fragmentation)

    Router is running JUNOS 20.4R3.8. Is there a utility on the JUNOS MX distribution to low level format a nand device (similar to nand-mediack on other JUNOS platforms)?  A low level format should remap any bad sectors.

    Else, can a USB flash drive be used for /altroot, /altconfig and /var (e.g. to substitute nand1)? This MX80 is scheduled to be replaced around the end of the year, but should be operational until then.

    Thanks.

    ------------------------------
    JAlvarez
    ------------------------------


  • 2.  RE: MX80 - Format nand1

    Posted 05-31-2022 11:06
    Couldn't find a low level format procedure for MX80 nand. Yet replacing nand1 with a USB flash drive is feasible with these steps:

    1. Create a snapshot on a USB drive. Example uses a SanDisk 8GB drive. Most 4 to 32GB drives should work with an MX80 running JUNOS 20.4R3.8.
    root@edge1> request system snapshot media usb partition
    Clearing current label...
    Partitioning usb media (da2) ...
    Doing the initial labeling...
    Partitions on snapshot:
    
      Partition  Mountpoint  Size    Snapshot argument
          a      /           637MB   root-size
          e      /config     101MB   config-size
          f      /var        6GB     var-size
    Running newfs (637MB) on usb media  / partition (da2s1a)...
    Running newfs (101MB) on usb media  /config partition (da2s1e)...
    Running newfs (6GB) on usb media  /var partition (da2s1f)...
    Copying '/dev/da0s1a' to '/dev/da2s1a' .. (this may take a few minutes)
    Copying '/dev/da0s1e' to '/dev/da2s1e' .. (this may take a few minutes)
    The following filesystems were archived: / /config
    root@edge1>​

    2. Change/etc/fstab entries from nand1 (da1) to USB (da2). Commented out da1s1b partitions (/tmp, /mfs) since the snapshot didn't create a da2s1b partition. Without dedicated partitions, those directories will become part of the root filesystem (/dev/da0s1a).
    # Device       Mountpoint  FStype  Options  Dump  Pass#
    /dev/da0s1a    /           ufs     rw        1    1
    /dev/da0s1e    /config     ufs     rw        2    2
    proc           /proc       procfs  rw        0    0
    /dev/da2s1f    /var        ufs     rw,noauto 2    2
    /dev/da0s1b    none       swap    sw        0    0
    #/dev/da1s1b    /tmp        mfs     rw,noauto 0    0
    #/dev/da1s1b    /mfs        mfs     rw,noauto 0    0
    /dev/da2s1a    /altroot    ufs     rw,noauto 2    0
    /dev/da2s1e    /altconfig  ufs     rw,noauto 2    0​


    3. Change boot order to only nand-flash0. Intent was to use nand-flash0,usb (USB last) but it kept changing to usb,nand-flash0 (USB first).

    root@edge1% sysctl -a | grep bootdev
    machdep.currbootdev: nand-flash0
    machdep.nextbootdev: usb
    machdep.bootdevs: usb,nand-flash0,nand-flash1
    
    root@core1% sysctl -w machdep.bootdevs=nand-flash0
    machdep.bootdevs: usb,nand-flash0,nand-flash1 -> nand-flash0
    
    root@core1% sysctl -a | grep bootdev
    machdep.currbootdev: nand-flash0
    machdep.nextbootdev: usb
    machdep.bootdevs: nand-flash0​


    4. Reboot.



    ------------------------------
    JAlvarez
    ------------------------------