Ethernet Switching
Ethernet Switching

Corrupt alternate partition

‎12-19-2012 03:00 PM

Greetings

 

I recently had a switch reboot to its alternate partition and consequently fail to rejoin its VC. So I decided to make sure that software versions were concurrent across both partitions on all of my EX 4200s.

 

The “request system snapshot media internal slice alternate” worked like a charm on all of my VC stacks except one. Now when I try to run “show system snapshot media internal slice 1” I get “error: cannot mount /dev/da0s1a” as a response and “error: Could not format alternate root” if I try to copy the partition again.

 

Is there any way to resolve this without reloading software or rebooting the VC?

 

Thanks in advance

-Matt

3 REPLIES 3
Ethernet Switching
Solution
Accepted by topic author Matt Richardson
‎08-26-2015 01:27 AM

Re: Corrupt alternate partition

‎12-25-2012 01:22 AM

It's better to tell us what Junos version you are using first.

 

But, for any Junos version, for the certain one you hit problem, you can try to install Junos again from the cli mode.

command similar to:

> request system software add /var/tmp/image.name.tgz member X  <- x here is the one you concern.

 

As everytime, install Junos to EX4200 from cli mode, it will default install to the alternate partition. so, if you reinstall the same Junos image again, the two partition will have same Junos image.

 

If the installation failed with similar failure like "“error: cannot mount /dev/da0s1a”"

You'd  better to do a format installation from loader prompt, see below KB for instruction.

 

http://kb.juniper.net/InfoCenter/index?page=content&id=KB20643

 

Juniper switches support
APAC
Ethernet Switching

Re: Corrupt alternate partition

‎12-28-2012 02:50 AM

Hi,

 

I had a similar problem with some standalone EX2200. About two weeks after I mirrored the snapshot to the alternate partition the switches were not able to mount those partitions again.

What fixed it for me was to simply "request system snapshot slice alternate" again to recover from this mount issue.

 

How have you done the snapshot? It seemed to me that this issue occured when I simply terminated my ssh session to the switch while the snapshot was still in progress (To wait 10 minutes for each switches snapshot is not an option if you have about 50...). I do not know how this mechanism works internally but maybe it needs the executing session to remain open. However the second time I kept all sessions open and until now none of the switches failed to mount the backup partition again.

 

Some outputs:

show system snapshot media internal
Information for snapshot on       internal (/dev/da0s1a) (primary)
Creation date: Oct 13 07:07:27 2012
JUNOS version on snapshot:
  jbase  : ex-11.4R5.5
  jcrypto-ex: 11.4R5.5
  jdocs-ex: 11.4R5.5
  jroute-ex: 11.4R5.5
  jswitch-ex: 11.4R5.5
  jweb-ex: 11.4R5.5
error: cannot mount /dev/da0s2a

 

show log snapshot
/sbin/snapshot-dual-root -X --target-slice alternate
Snapshot source: internal (/dev/da0)
Snapshot target: external (/dev/da1)
  DUMP: WARNING: should use -L when dumping live read-write filesystems!
cannot open /dev/tty: Device not configured
  DUMP: Date of this level 0 dump: Wed Nov  7 09:10:09 2012
  DUMP: WARNING: no file `/etc/dumpdates', making an empty one
  DUMP: Date of last level 0 dump: the epoch
  DUMP: Dumping /dev/da0s1a (/) to standard output
  DUMP: mapping (Pass I) [regular files]
  DUMP: mapping (Pass II) [directories]
  DUMP: estimated 97730 tape blocks.
  DUMP: dumping (Pass III) [directories]
  DUMP: dumping (Pass IV) [regular files]
warning: ./.snap: File exists
  DUMP: 97.86% done, finished in 0:00 at Wed Nov  7 09:15:16 2012
  DUMP: DUMP: 99074 tape blocks
  DUMP: finished in 405 seconds, throughput 244 KBytes/sec
  DUMP: level 0 dump on Wed Nov  7 09:10:09 2012
  DUMP: DUMP IS DONE      // I think this was the end of the file after the first snapshot was taken (the one where I terminated the session)


/sbin/snapshot-dual-root -X --info internal
Snapshot source: internal (/dev/da0)
Snapshot target: internal (/dev/da0)
1+0 records in
1+0 records out
512 bytes transferred in 0.002374 secs (215676 bytes/sec)
** /dev/da0s1a (NO WRITE)
** Last Mounted on /
** Root file system
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
1449 files, 48305 used, 45285 free (29 frags, 5657 blocks, 0.0% fragmentation)
umount: /tmp/snap-tmp.61334/mnt.61334: not a file system root directory
** /dev/altroot (NO WRITE)
** Last Mounted on /altroot
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
1446 files, 48348 used, 45242 free (26 frags, 5652 blocks, 0.0% fragmentation)
mount: /dev/da0s2a : Operation not permitted  // This propably occured when I tried to display the snapshot levels some time later


/sbin/snapshot-dual-root -X --target-slice alternate
Snapshot source: internal (/dev/da0)
Snapshot target: external (/dev/da1)
  DUMP: WARNING: should use -L when dumping live read-write filesystems!
  DUMP: Date of this level 0 dump: Thu Nov 22 11:35:27 2012
cannot open /dev/tty: Device not configured
  DUMP: Date of last level 0 dump: the epoch
  DUMP: Dumping /dev/da0s1a (/) to standard output
  DUMP: mapping (Pass I) [regular files]
  DUMP: mapping (Pass II) [directories]
  DUMP: estimated 97732 tape blocks.
  DUMP: dumping (Pass III) [directories]
  DUMP: dumping (Pass IV) [regular files]

.

.

.

  DUMP: DUMP: 99077 tape blocks
  DUMP: finished in 125 seconds, throughput 792 KBytes/sec
  DUMP: level 0 dump on Thu Nov 22 11:35:27 2012
  DUMP: DUMP IS DONE
warning: cannot create symbolic link ./etc/localtime->/var/etc/localtime: File exists
warning: cannot create symbolic link ./etc/ssh/ssh_host_key->/config/ssh_host_key: File exists
warning: cannot create symbolic link ./etc/ssh/ssh_host_key.pub->/config/ssh_host_key.pub: File exists
warning: cannot create symbolic link ./etc/ssh/ssh_host_dsa_key->/config/ssh_host_dsa_key: File exists
warning: cannot create symbolic link ./etc/ssh/ssh_host_dsa_key.pub->/config/ssh_host_dsa_key.pub: File exists
warning: cannot create symbolic link ./etc/ssh/ssh_host_rsa_key->/config/ssh_host_rsa_key: File exists
warning: cannot create symbolic link ./etc/ssh/ssh_host_rsa_key.pub->/config/ssh_host_rsa_key.pub: File exists
warning: cannot create symbolic link ./etc/ssh/ssh_host_ecdsa_key->/config/ssh_host_ecdsa_key: File exists
warning: cannot create symbolic link ./etc/ssh/ssh_host_ecdsa_key.pub->/config/ssh_host_ecdsa_key.pub: File exists
/sbin/snapshot-dual-root -X --info internal
Snapshot source: internal (/dev/da0)
Snapshot target: internal (/dev/da0)
1+0 records in
1+0 records out
512 bytes transferred in 0.002590 secs (197688 bytes/sec)
** /dev/da0s1a (NO WRITE)
** Last Mounted on /
** Root file system
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
1450 files, 48306 used, 45284 free (28 frags, 5657 blocks, 0.0% fragmentation)
umount: /tmp/snap-tmp.61556/mnt.61556: not a file system root directory
** /dev/da0s2a
FILE SYSTEM CLEAN; SKIPPING CHECKS
clean, 45285 free (53 frags, 5654 blocks, 0.1% fragmentation)

Ethernet Switching

Re: Corrupt alternate partition

‎11-08-2018 07:31 PM

Okay, this was weird. I read elsewhere that if you go into the shell and unmount the alternate partition, it would fix the problem. I tried to do that but I didn't have the root password so I couldn't run the command. I exited out of the shell and now it is showing me both partitions. So I was able to do the upgrade successfully. A mystery, but I thought I'd share it.